Hello Forum Members,
I have a spreadsheet that will monitor payment schedules, in which both payment frequency and the payment start date are inputted by the user.
As such, to make filling out the column(s) fool-proof, I want to grey out cells in which data should not be entered.
For example, if the payment frequency is every 6th day, and the payments are to begin on day 0, then days 0, 6, 12 (etc) should be left white, whereas the remainder of the cells should be shaded.
I can achieve this using multiple conditional formatting rules in excel2007 with iterations of formulae of the type:
(where P5 and P7 are user input cells)
(see attached sample .xlsx sheet and image of same)
I would like a VBA solution so that it can be used in earlier versions of excel that don't have the advantage of >3 CF rules.
Ideally, I would like the following to be achieved:
1. VBA for the above mentioned, based on the 2 user-inputs (payment frequency and start date);
2. is it also possible to not only shade the appropriate cells, but to render them locked such that no text can physically be entered? ;
3. a separate VBA that allows the user to reset the appropriate column back to default state (ie, remove all shading, delete all entered text)
I am new to VBA, so I would greatly appreciate it if someone could get me started and point me in the right direction. I have scoured numerous 'alternate shading' posts but I can't seem to find something that is closely related to what I want to do.
Many thanks for any advice.
Z.
Bookmarks