could you pl attach yr excel sheet with macro for fast reply!
Private Sub Worksheet_Change(ByVal NameBox As Range)
Dim c As Range
Range ("c4:m4")
'For Each c In Range("c4:m4")
'If Not IsNumeric(c) Then
c.ClearContents
' Next c
'End If
Insert_Block
End Sub
Option Explicit
Const SUMMARY_COLOR = 48
Const DETAIL_COLOR = 36
Sub Insert_Block()
With Range("C4")
.Formula = "=VLOOKUP( B4,'EXCEPTION % SUMMARY'!$A:$N,3,FALSE)"
.Value = .Value
End With
With Range("D4")
.Formula = "=VLOOKUP( B4,'EXCEPTION % SUMMARY'!$A:$N,4,FALSE)"
.Value = .Value
End With
With Range("E4")
.Formula = "=VLOOKUP( B4,'EXCEPTION % SUMMARY'!$A:$N,5,FALSE)"
.Value = .Value
End With
With Range("F4")
.Formula = "=VLOOKUP( B4,'EXCEPTION % SUMMARY'!$A:$N,6,FALSE)"
.Value = .Value
End With
With Range("G4")
.Formula = "=VLOOKUP( B4,'EXCEPTION % SUMMARY'!$A:$N,7,FALSE)"
.Value = .Value
End With
With Range("H4")
.Formula = "=VLOOKUP( B4,'EXCEPTION % SUMMARY'!$A:$N,8,FALSE)"
.Value = .Value
End With
With Range("I4")
.Formula = "=VLOOKUP( B4,'EXCEPTION % SUMMARY'!$A:$N,9,FALSE)"
.Value = .Value
End With
With Range("J4")
.Formula = "=VLOOKUP( B4,'EXCEPTION % SUMMARY'!$A:$N,10,FALSE)"
.Value = .Value
End With
With Range("K4")
.Formula = "=VLOOKUP( B4,'EXCEPTION % SUMMARY'!$A:$N,11,FALSE)"
.Value = .Value
End With
With Range("L4")
.Formula = "=VLOOKUP( B4,'EXCEPTION % SUMMARY'!$A:$N,12,FALSE)"
.Value = .Value
End With
With Range("M4")
.Formula = "=VLOOKUP( B4,'EXCEPTION % SUMMARY'!$A:$N,13,FALSE)"
.Value = .Value
End With
End Sub
Title | # Comments | Views | Activity |
---|---|---|---|
Populate a value in one spreadsheet based on values in another spreadsheet | 6 | 31 | |
Excel macro sheet auto run and save to xlsx | 5 | 16 | |
Excel - Macro hide columns not working | 4 | 18 | |
MS Excel "--" in Formula What is it doing? | 3 | 9 |
Join the community of 500,000 technology professionals and ask your questions.
Connect with top rated Experts
6 Experts available now in Live!