BrI
11-19-2017, 12:19 PM
I want to loop through several textboxes on a userform and change the color of each, box names end with 1,2, 3...etc. I can change values of these boxes as follows:
Me.Controls("TextBox_" & i).Value '<--- value works
But variations of the above for backcolor are not working when use a counter, for example not working:
Me.("TextBox_" & i).BackColor = vbYellow '<--- backcolor not working
I have seen some examples using "Got Focus" but need separate Event entry for each textbox and was hoping to avoid this if possible.
Thanks
Me.Controls("TextBox_" & i).Value '<--- value works
But variations of the above for backcolor are not working when use a counter, for example not working:
Me.("TextBox_" & i).BackColor = vbYellow '<--- backcolor not working
I have seen some examples using "Got Focus" but need separate Event entry for each textbox and was hoping to avoid this if possible.
Thanks