View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Trefor Trefor is offline
external usenet poster
 
Posts: 201
Default Multiple Colour changes on User Form

On a userform I have a "Frame" containing a bunch of text boxes. If the text
box contains the word "Completed" it changes the text box to Black on Green
other it set the text bov to Red on Red. Below is the Module code I am using,
as it stands I am going to have to code this for each and every text box in
the frame. Is it possible to run a loop of some sort across all text boxes in
the one frame?


If Menu.StatusUnisysComp.Value = "Completed" Then
Menu.StatusUnisysComp.ForeColor = 0
Menu.StatusUnisysComp.BackColor = RGB(0, 255, 0)
Else
Menu.StatusUnisysComp.ForeColor = RGB(255, 0, 0)
Menu.StatusUnisysComp.BackColor = RGB(255, 0, 0)
End If

If Menu.StatusNSR.Value = "Completed" Then
Menu.StatusNSR.ForeColor = 0
Menu.StatusNSR.BackColor = RGB(0, 255, 0)
Else
Menu.StatusNSR.ForeColor = RGB(255, 0, 0)
Menu.StatusNSR.BackColor = RGB(255, 0, 0)
End If

--
Trefor