how do compare cell in work sheet to another cell in another sheet in vba macro excel 2003
thanks
Printable View
how do compare cell in work sheet to another cell in another sheet in vba macro excel 2003
thanks
Sub macro1()
Dim rng As Range
Dim md1 As Integer
For Each rng In Range("B2:B256")
For Each rng1 In Range("G2:G3000")
If (Sheets("Sheet1").Cells(rng.Row, 2).Value) = Sheets("Sheet2").Cells(rng1.Row, 7).Value Then
MsgBox (rng)
md1 = md1 + 1
MsgBox md1
End If
Next
Next
End Sub[/COLOR][/COLOR][/COLOR][/COLOR]
it would be advantageous to use excel's find (and findnext) method to do this