Public Schedule Face-to-Face & Online Instructor-Led Training - View dates & book

validation in excel vba

Forum home » Delegate support and help forum » Microsoft Excel VBA Training and help » VALIDATION IN EXCEL VBA

VALIDATION IN EXCEL VBA

ResolvedVersion 2003

Tony has attended:
Excel VBA Intro Intermediate course
Excel VBA Advanced course
Access Intermediate course
Access Advanced course

VALIDATION IN EXCEL VBA

How do you create cell validation in VBA. My basic spreadsheet has validation rules in the sheet. However, on creating a new spreadsheet, the delete data routines clear the validations. Threrefore, I need to create validation rules against a list either on a sheet that is not changed or in the code

RE: VALIDATION IN EXCEL VBA

Hi Tony

Thanks for your question

It is possible to create validation rules in VBA. Simply create a procedure that checks the value of various cells and warns if they don't meet certain criteria, and then set it to run on the worksheet's change event.
Alternatively, in the example you have provided, why not create your workbook with all the validation rules in place and then save it as a template? Then every time you create a new instance of the template all the rules will be in place

Regards

Stephen

 

Training courses

Training information:

Welcome. Please choose your application (eg. Excel) and then post your question.

Our Microsoft Qualified trainers will then respond within 24 hours (working days).

Frequently Asked Questions
What does 'Resolved' mean?

Any suggestions, questions or comments? Please post in the Improve the forum thread.

Excel tip:

DATEDIF function

The DATEDIF function is a worksheet function that computes the difference between two dates. This function is documented only in the help files for Excel 2000. It isn't documented in Excel 2002.
the formula function is:
=DATEDIF(Your age,Today(),"Y")
Y stands for year

View all Excel hints and tips

Connect with us:

0207 987 3777

Call for assistance

Request Callback

We will call you back

Server loaded in 0.1 secs.