I would like to highlight certain data (ID) and pop out a message based on the following IF statement
I have two Workbook - Book 1 and Book 2
I need to check the ID ( Book1 - Column S) against ( Book 2 - Column J) and execute IF statement
If (ID is found) ,
if (Book 2 - Remarks Column"P") = Open A/R OR Merged Then
Highlight "Blue" (row in book1)
Message pop out "Confirm Delete?"
else
Highlight "Green" (row in book1)
Else (ID is not found)
Highlight "Red" (row in book1)
Any ways to solve this ?
Thanks in advance
Need it urgently 
Cross Ref: http://www.mrexcel.com/forum/excel-q...ml#post4226874
Sub CheckIDs()
On Error Resume Next
Dim rng As Range, str As String
Dim Wkb1, Wkb2 As Workbook
Set Wkb1 = Workbooks("Book1") ' replace with name of open workbook 1
Set Wkb2 = Workbooks("Book2") ' replace with name of open workbook 2
For Each rng In Wkb1.ActiveSheet.UsedRange.Column("S").Cells
str = WorksheetFunction.VLookup(rng.Value, Wkb2.ActiveSheet.UsedRange.Columns("J:P"), 7, False)
If Err.Description = "" Then ' ID found...
If str = "Open A/R OR Merged" Then
rng.Interior.Color = RGB(0, 0, 255) ' blue
Select Case MsgBox("Confirm delete?", vbYesNo)
Case vbYes
' what to do here????
Delete row in Book 1 (ID row)
Case vbNo
' what to do here???
continue the loop till all the ids are check
End Select
Else
rng.Interior.Color = RGB(0, 255, 0) ' green
End If
Else ' no ID found...
Err.Clear
rng.Interior.Color = RGB(255, 0, 0) ' red
End If
Next rng
End Sub
Bookmarks