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!

Call a macro from within an Excel worksheet 2

Status
Not open for further replies.

MrMajik

IS-IT--Management
Apr 2, 2002
267
I have a worksheet that has 200 cells that I want to test what the user enters without having the user to click a button or do some other action. The cells need to have real numbers only, no text.

I thought about calling a macro to test the contents of cells when one of the cells loses the focus but I don't know if this can be done in Excel.

Any ideas on how to test the content of a cell after the user exits the cell?

Thank you.
 
No need for any code (although you would typically use the worksheet CHANGE event for this kind of thing)
Just use data>Validation and set it to allow Whole Number or Decimal (pick from the list in the validation dialogue box)

Rgds
Geoff
"Some cause happiness wherever they go; others whenever they go."
-Oscar Wilde
 
Open the VB Project editor and double click ThisWorkbook. Do whatever you need to do with the SheetChange event.

Good Luck!

 
Geoff; Thanks. Works like a charm and just what I was in search of! Here's a star :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top