PDA

View Full Version : [SOLVED] Need to loop until last cell need to modify



elmnas
05-27-2015, 01:18 AM
Hello guys I made this code so far

but I do specify the last cell but I want instead the script loops to the last used cell

Could someone help me to modify the code a bit?

Thank you in advance

See code below:




Sub CheckMatch()
For i = 2 To 230 ' I Want to modify this part
If Cells(i, "J") = Cells(i, "K") And Len(Cells(i, "B")) <> 0 And Cells(i, "AB") <> 0 Then
MsgBox "Row " & i & " match"


End If
Next i
End Sub

mancubus
05-27-2015, 02:20 AM
see my post in below thread of yours:
http://www.vbaexpress.com/forum/showthread.php?52693-Compare-two-cell-in-two-columns-and-present-in-new-column