Visual Basic Example for Validating Data on Entry (139663)
The information in this article applies to:
- Microsoft Excel 97 for Windows
- Microsoft Excel for Windows 95
- Microsoft Excel for Windows 5.0
This article was previously published under Q139663 SUMMARY
To automate a task or perform an operation when data is entered into a
specific range on a Microsoft Excel worksheet, you can use the OnEntry and
Intersect methods in a Visual Basic for applications macro. You can use
this type of macro to validate data entry, to verify that a value is within
a specified range, for example.
NOTE: The macro provided below will run in Microsoft Excel 97 but you do
not have to use the macro to validate data that is entered into cells.
Microsoft Excel 97 has a new Data Validation feature that allows you to
specify what data is valid for certain cells and ranges.
REFERENCES
For more information about Data Validation, click the Index tab in
Microsoft Excel 97 Help, type the following text
data validation, preventing incorrect entry
and then double-click the selected text to go to the "Prevent entry of
incorrect data in a cell" topic.
For more information about OnEntry or Intersect, click the Index tab in
Microsoft Excel 7.0 Help, type either of the following
and then double-click the selected text to go to the desired topic.
Modification Type: | Minor | Last Reviewed: | 10/11/2006 |
---|
Keywords: | kbdtacode kbhowto kbProgramming KB139663 |
---|
|