PC Review


Reply
Thread Tools Rate Thread

Cell contents check and prompt out message (By using Macro)

 
 
tlee
Guest
Posts: n/a
 
      15th May 2009
Hi all,

Could you know how to use Macro to check the cell contents with specified
"String" and prompt out Message box?

E.g. If the Column B1 = "USA" and Column H1 ="Mexico" , prompt the message
box "USA and Mexico are found".

Thanks,
Tlee


 
Reply With Quote
 
 
 
 
Barb Reinhardt
Guest
Posts: n/a
 
      15th May 2009
I'm thinking you want something like this

Msgbox(Range("B1") & " and " & range("H1") & " are found.")

This assumes that these ranges are on your active sheet.


"tlee" wrote:

> Hi all,
>
> Could you know how to use Macro to check the cell contents with specified
> "String" and prompt out Message box?
>
> E.g. If the Column B1 = "USA" and Column H1 ="Mexico" , prompt the message
> box "USA and Mexico are found".
>
> Thanks,
> Tlee
>
>
>

 
Reply With Quote
 
Barb Reinhardt
Guest
Posts: n/a
 
      15th May 2009
I've used the examples here

http://www.cpearson.com/excel/vbe.aspx

to get to Modules and Procedures. Try it and if it doesn't work, come back
and post what you have.

HTH,
Barb Reinhardt

"tlee" wrote:

> Hi all,
>
> Could you know how to use Macro to check the cell contents with specified
> "String" and prompt out Message box?
>
> E.g. If the Column B1 = "USA" and Column H1 ="Mexico" , prompt the message
> box "USA and Mexico are found".
>
> Thanks,
> Tlee
>
>
>

 
Reply With Quote
 
Barb Reinhardt
Guest
Posts: n/a
 
      15th May 2009
This was a reply to another post.

"Barb Reinhardt" wrote:

> I've used the examples here
>
> http://www.cpearson.com/excel/vbe.aspx
>
> to get to Modules and Procedures. Try it and if it doesn't work, come back
> and post what you have.
>
> HTH,
> Barb Reinhardt
>
> "tlee" wrote:
>
> > Hi all,
> >
> > Could you know how to use Macro to check the cell contents with specified
> > "String" and prompt out Message box?
> >
> > E.g. If the Column B1 = "USA" and Column H1 ="Mexico" , prompt the message
> > box "USA and Mexico are found".
> >
> > Thanks,
> > Tlee
> >
> >
> >

 
Reply With Quote
 
tlee
Guest
Posts: n/a
 
      16th May 2009
Barb,

Thanks for your help and information.

I would like to use control flow to check the cell "B1" and "H1" such as if
statement. After checked, promot message or continous run the code.

Thanks
Tlee

> I'm thinking you want something like this
>
> Msgbox(Range("B1") & " and " & range("H1") & " are found.")
>
> This assumes that these ranges are on your active sheet.
>
>
> "tlee" wrote:
>
>> Hi all,
>>
>> Could you know how to use Macro to check the cell contents with specified
>> "String" and prompt out Message box?
>>
>> E.g. If the Column B1 = "USA" and Column H1 ="Mexico" , prompt the
>> message
>> box "USA and Mexico are found".
>>
>> Thanks,
>> Tlee
>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
vba to check cell contents Steve Microsoft Excel Misc 1 29th Jul 2009 04:57 PM
'IF' Macro to insert cell contents to alternate cell if cell not e Gryndar Microsoft Excel Worksheet Functions 6 20th Dec 2008 05:02 PM
Macro to clear range contents when cell contents are changed by us =?Utf-8?B?U3RldmUgRQ==?= Microsoft Excel Programming 12 22nd Feb 2007 09:09 PM
Macro to remove contents of cell and move all other contents up one row adw223 Microsoft Excel Misc 1 1st Jul 2005 03:57 PM
Macro/message box to prompt user for their name and save name to cell robertguy Microsoft Excel Misc 2 3rd Mar 2004 08:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:07 PM.