Reputation: 17418
Creating, for example, a date validation for one rows of one cell in excel 2010 is no problem. Can I automatically apply this validation rule to all subsequent rows of that column when I create an excel sheet from this template?
Upvotes: 0
Views: 118
Reputation: 5151
You can identify the last row of a column, like so
finalRow = cells(1000000,1).end(xlup).row
and then loop through the column to apply your validation to every cell in that column. So,
for i = 1 to finalRow
'your validation code here which will refer to the ith row (e.g., cells(i,1))
'column A = 1; column B = 2, and so on
next i
Hope that helps.
Upvotes: 1