ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cell contents check and prompt out message (By using Macro) (https://www.excelbanter.com/excel-programming/428546-cell-contents-check-prompt-out-message-using-macro.html)

tlee

Cell contents check and prompt out message (By using Macro)
 
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



Barb Reinhardt

Cell contents check and prompt out message (By using Macro)
 
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




Barb Reinhardt

Cell contents check and prompt out message (By using Macro)
 
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




Barb Reinhardt

Cell contents check and prompt out message (By using Macro)
 
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




tlee

Cell contents check and prompt out message (By using Macro)
 
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







All times are GMT +1. The time now is 12:09 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com