If Then macro needed

R

Roger

I have a situation where I need to insert a line of code into a macro I have,
but I need some help.

I need to have the macro present a message to the user if any number is
present in a particular cell.

So basically this: If cell a7 contains "any number" then message box "this
cell contains QTY"...

thanks in advance for the assistance.
 
T

Toppers

try:

If IsNumeric(Range("A7")) And Range("A7") <> "" Then
MsgBox "This cell contains QTY " & Range("A7")
End If
 
R

Roger

Perfect, almost.... Is there are way to make it so when this does happen,
the macro will stop where the situation occured?
 
T

Toppers

If IsNumeric(Range("A7")) And Range("A7") <> "" Then
MsgBox "This cell contains QTY " & Range("A7")
Exit sub ' (or END)
End If
 
Top