A while ago a User asked a question with somewhat complicated conditional formatting that also required an existing User Id. I can't find the original question, but I was interested in the question, and had some time for a solution. The question was something like:
I am looking to conditionally format column B. In column C, there is a ‘Date to be completed’.
If there is no date in column C, column B should not be formatted.
If column C has a date, and today’s date is within 7 days plus or minus, column B cell should be yellow.
If today’s date greater than 7 days from the column C date, column B cell should be red.
Once a date is entered in column E – completed date field – I would like whatever condition that may have been applied above to persist.
In column E, I have a completed date field. Once the completed date is entered, column A cell should be green.
In column H, ‘Completed By’ column – is there any way to auto populate the user that inputs the completed date in column E? No idea if that is a possibility.
-------------------
I translated the above requirements into the following that was easier for me to follow:
a. Add 'Completed By' Name in Column 'H' when date is entered in Column 'E'.
b. Turn Column 'A' green when Column 'E' has a date.
c. Column 'B' no Color when, Column 'C' is BLANK.
d. Column 'B' Yellow when, Column 'C' is <= Today +/- 7 days.
e. Column 'B' red when, Column 'C' is > Today +/- 7 days.
f. Column 'B' DOES NOT CHANGE COLOR when there is a Date in Column 'E'
-----------------
Since I am not very good at Conditional formatting (maybe that is why I don't like it), I solved the problem (see attached file and code below) using:
a. Small UserForm to select from a list of pre-existing User Ids.
b. Worksheet_Change event handlers to satisfy the other requirements
In the ThisWorkbook Code module:
In the Sheet1 Code module:
In the UserFormLogin Code Module:
In the ModPseudoConditionalFormattingOrdinary Code module:
In the ModUserFormLoginOrdinary Code module:
Lewis
Bookmarks