I have an Excel VBA form that I use for data entry and data retrieval. (People don’t need to know how to use Excel.) One field in the form compares the current date to a previous date stored in a cell. If it is more than 2 weeks old, I want to see the textbox font in red. I can use conditional formatting to change the font color in the CELL, but not in the userform’s TEXTBOX. Basically, when the user finds a record with a date requiring attention, I want it to be noticed. There must be some conditional code I can use. Any help is appreciated.
Share
Here is some code that will change the color of the text in a Textbox on a User Form, based on the difference in dates between Today and a date in a worksheet cell:
You will need to change the worksheet name and cell reference and the name of the Textbox on the user form.
The code could go in the user form Activate section.
Hope this was what you were looking for.
Regards