Data Validation to VBA

Src016

New Member
Joined
May 21, 2019
Messages
10
Hi All!

I need to translate the following data validation rules to VBA:

Rule 1:
Cell does not contain: no blanks format - as white
-- stop as true

Rule 2:
=OR($J3="Pending - Please Elaborate in Notes")

as red


Both of these formatting rules apply to $K2 through $K1048576

I am generating templates and need this conditional to run within a sub that runs as soon as you open the workbook.

This would be a huge help!
Thanks
Spence
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
What you are describing is conditional formatting, not data validation.

Do you want VBA create these rules and add them to the sheet? Why not just put the rules right into the template, rather than running VBA to create them? Not clear on why you are looking to do this in VBA.
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,223
Members
452,620
Latest member
dsubash

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top