rrtts
01-17-2008, 01:15 PM
I have a series of textboxes on a userform. I'd like to color code the textboxes based on their value in order to easily distinguish similar values.
I have used a code similar to this in the past, but now I have roughy 40 textboxes with 10 different values that can be selected. To use the code below for each value on every textbox would be rather lengthy and very inefficient. However, I can't seem to figure out an alternative solution.
Any help would be greatly appreciated.
If Userform1.Textbox1.value = "xxx" Then Userform1.Textbox1.BackColor = RGB(xxx, xxx, xxx)
I have used a code similar to this in the past, but now I have roughy 40 textboxes with 10 different values that can be selected. To use the code below for each value on every textbox would be rather lengthy and very inefficient. However, I can't seem to figure out an alternative solution.
Any help would be greatly appreciated.
If Userform1.Textbox1.value = "xxx" Then Userform1.Textbox1.BackColor = RGB(xxx, xxx, xxx)