LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple sheets, one user form, and a unique ID [email protected] Excel Programming 1 March 6th 06 05:30 PM
User Form to Filter by Multiple Criteria DevDaniel Excel Programming 0 January 26th 06 03:21 PM
How to: User Form to assign a user defined range to a macro variab TrevTrav Excel Programming 1 March 22nd 05 07:57 PM
USer Form Entry to multiple cells Jerry Eggleston Excel Programming 0 May 26th 04 12:20 AM


All times are GMT +1. The time now is 09:41 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"