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