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

Glen,

Conditional Formatting would be perfect and I know how to do this on a
worksheet, how does this work on a userform?

--
Trefor


"Glen Mettler" wrote:

Why not use Conditional Formating?

Glen

"Trefor" wrote in message
...
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