Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a UserForm that contains about 28 TextBoxes. I need to change the Back
and Fore color of the textboxes based on the values inside each textbox. Below is an example of what I am looking to accomplish: Private Sub txtbx2_Change() If txtbx2.Text = "actual" Then ctl.BackColor = &H8000& ctl.ForeColor = &HFFFFFF ElseIf txtbx2.Text = "projected" Then ctl.BackColor = &H8000& ctl.ForeColor = &HFFFFFF End If End Sub but I don't want to have to write this code for each and every textbox on the form. Is there a way to do this within one subroutine? I am looking for one subrutine that would automatically update the textboxes once the value in it is change and focus is set to another control on the form. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
change forecolor with code | Excel Discussion (Misc queries) | |||
Fill.backcolor and forecolor do not consistent in Chart and Shapes | Excel Programming | |||
TextBox BackColor | Excel Programming | |||
BackColor, Forecolor, Bold, and Font Size for ComboBox in Commandbar | Excel Programming | |||
BackColor, Forecolor, Bold, and Font Size for ComboBox in Commandbar | Excel Programming |