Validation and pop up message in a Macro

BBQKING3

Board Regular
Joined
Nov 16, 2005
Messages
76
:biggrin:

I need to validate two cells during a macro. If they don't match, end the macro and send the user a pop up message.
 

Some videos you may like

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,048
Office Version
  1. 365
Platform
  1. Windows
Like this perhaps.
Code:
If Range("A1").Value <>Range("A2").Value Then
     Msgbox "Mismatch, code terminating"
     Exit Sub
End If
 

Watch MrExcel Video

Forum statistics

Threads
1,118,228
Messages
5,571,012
Members
412,353
Latest member
SofiaV
Top