Hi all,
I have a userform with lots of different textboxes each in groups. Just wondering if I can loop through the textboxes to change their colour based on certain values,
for example, if the value in the text box is less than 1000 then red, less than 500 then amber or less than 250 then green?
I tried the following:
but that doesnt seem to do anything... any ideas?
cheers
colin
I have a userform with lots of different textboxes each in groups. Just wondering if I can loop through the textboxes to change their colour based on certain values,
for example, if the value in the text box is less than 1000 then red, less than 500 then amber or less than 250 then green?
I tried the following:
Code:
Dim h
For h = 5 To 17
With UserForm1.Controls("Textbox" & h)
If .Value < 1000 Then
.Interior.ColorIndex = 3
End If
End With
Next h
but that doesnt seem to do anything... any ideas?
cheers
colin