Hello people I have made following code but I need help to skip the blank cells that matching,
Could someone help me?
Thank you in advance
Code:
Sub Compare()
Dim ws1 As Worksheet
Dim ws2 As Worksheet
Dim r As Long
Dim m As Long
Dim s As Long
Dim n As Long
Set ws1 = ActiveSheet
m = ws1.range("A" & ws1.Rows.Count).End(xlUp).Row
Set ws2 = Worksheets("sheet2")
n = ws2.range("A" & ws2.Rows.Count).End(xlUp).Row
For r = 1 To m
For s = 1 To n
If ws1.range("A" & r) = ws2.range("A" & s) And _
ws2.range("B" & r) = ws2.range("B" & s) Then
MsgBox ws2.range("A" & s).Text
Exit For
End If
Next s
Next r
End Sub
Thank you in advance