MESSAGE ALERT

  • Thread starter Thread starter Shyla
  • Start date Start date
S

Shyla

I am having difficulty creating a macro that would display
a message 'value does not' if a value in cell A2 on
worksheet1 does not match with the value in cell A2 on
worksheet2. Please someone help me, thanks.
 
Shyla,

If Sheets("Sheet1").Range("A2") <> Sheets("Sheet2").Range("A2") Then
Msgbox "Value does not match"
End If

Change Sheet1 and Sheet2 to the sheet names.

Or
If Activecell <> Sheets("Sheet2").Range(Activecell.Address) Then
Msgbox "Value does not match"
End If
 
If Worksheets("[name of worksheet1]".Range("A1").Value <>
Worksheets("[name of worksheet2]").Range("A2").Value Then
Msgbox "Value does not match"
Else: End If
 
Back
Top