Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.
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
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.