Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 226
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 226
Default 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.

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4,339
Default 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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro Help Needed - Excel 2007 - Print Macro with Auto Sort Gavin Excel Worksheet Functions 0 May 17th 07 01:20 PM
Help needed with a macro Victor Delta Excel Discussion (Misc queries) 8 February 24th 07 11:14 PM
Macro help needed iontrap Excel Discussion (Misc queries) 0 November 30th 06 02:58 PM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 1 June 11th 05 12:44 AM
Macro needed to Paste Values and prevent Macro operation thunderfoot Excel Discussion (Misc queries) 0 June 10th 05 03:38 PM


All times are GMT +1. The time now is 05:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"