![]() |
If Then macro needed
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. |
If Then macro needed
try:
If IsNumeric(Range("A7")) And Range("A7") < "" Then MsgBox "This cell contains QTY " & Range("A7") End If "Roger" wrote: 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. |
If Then macro needed
Perfect, almost.... Is there are way to make it so when this does happen,
the macro will stop where the situation occured? "Toppers" wrote: try: If IsNumeric(Range("A7")) And Range("A7") < "" Then MsgBox "This cell contains QTY " & Range("A7") End If "Roger" wrote: 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. |
If Then macro needed
If IsNumeric(Range("A7")) And Range("A7") < "" Then MsgBox "This cell contains QTY " & Range("A7") Exit sub ' (or END) End If "Roger" wrote: Perfect, almost.... Is there are way to make it so when this does happen, the macro will stop where the situation occured? "Toppers" wrote: try: If IsNumeric(Range("A7")) And Range("A7") < "" Then MsgBox "This cell contains QTY " & Range("A7") End If "Roger" wrote: 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. |
All times are GMT +1. The time now is 04:55 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com