Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MSGBOX for Excel VBA?

Status
Not open for further replies.

Steven547

Technical User
Sep 15, 2004
165
US
Hey everyone...In EXCEL, how would I write code for a specific cel? Say if someone clicked on cel A:1, I want to have a msgbox appear....Or if a value in a cel was wrong, a msgbox appear for that as well....

thanks.
 
Have a look at the events of the Worksheet object like, eg, the Worksheet_SelectionChange event procedure.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 


"Or if a value in a cel was wrong, a msgbox appear for that as well...."

Also check out the Worksheet_Change event.

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
If there is a formula in a cell, then either use Worksheet_Calculate event or, as Skip suggested, Worksheet_Change event, but test cells with input values.
For simple input testing there is no need to use vba. 'Data>Data validation' tool is usually sufficient and impressive with input and error messages set (but it does not prevent from pasting data).

combo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top