I want to apply the code below for Column T without Copy the same codes.
Apply for both Column S and Column T
Any way to do this ?
Thanks in advance .
For Each rng In Wkb1.ActiveSheet.UsedRange.Columns("S").Cells
str = WorksheetFunction.Vlookup(rng.Value, Wkb2.ActiveSheet.UsedRange.Columns("J:P"), 7, False)
str2 = WorksheetFunction.Vlookup(rng.Value, Wkb2.ActiveSheet.UsedRange.Columns("J:N"), 5, False) 'reject column
If Err.Description = "" Then ' ID found...
If str = "Open A/R" Or str = "Merged" Then
rng.Interior.Color = RGB(0, 0, 255) ' blue
Else
rng.Interior.Color = RGB(0, 255, 0) ' green
End If
' Reject column
If str2 = "2" Then
rng.Interior.Color = RGB(255, 255, 0) ' yellow
Else
'do nothing
End If
Else ' no ID found...
Err.Clear
End If
Next rng
Bookmarks