Good Morning Experts,
Please see code below. I tried to explain what I want to do, but I'm having trouble putting it all together. Any solutions, guidance or advice would be appreciated.
Please see code below. I tried to explain what I want to do, but I'm having trouble putting it all together. Any solutions, guidance or advice would be appreciated.
Code:
Sub HELPME()
Dim lrow As Long
Dim myworksheet As Worksheet
Dim myWorksheet2 As Worksheet
Dim lrow2 As Long
Set myworksheet = Worksheets("Sheet1")
lrow = myworksheet.Cells(myworksheet.Rows.Count, "A").End(xlUp).row
Set myWorksheet2 = Worksheets("Sheet2")
lrow2 = myWorksheet2.Cells(myWorksheet2.Rows.Count, "A").End(xlUp).row
Application.ScreenUpdating = False
Application.DisplayAlerts = False
r = 2
Do Until r = 2 & lrow2
lookup_cell = Sheet1.Range("B" & r)[COLOR=#008000] 'look up this cell - SHEET1[/COLOR]
lookup_range = Sheet2.Range("B" & r) [COLOR=#008000]'look for it in this range - SHEET2[/COLOR]
compare_cell1 = Sheet2.Range("A" & r) [COLOR=#008000]'IF FOUND,compare_cell1 vs. compare_cell2[/COLOR]
compare_cell2 = Sheet1.Range("A" & r)
return_value = Sheet1.Range("A" & r) [COLOR=#008000]'If the compared cells match, then return TRUE, otherwise FALSE in SHEET1 "C2"[/COLOR]
[COLOR=#ff0000] if istr(lookup_cell,[/COLOR]
r = r + 1
Loop
End Sub