Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
-Hello,
What is the macro for changing the font color in a specific range based on the text entered? For instance, if user types in "Completed" into any cell in range B7:B175 the cell with completed should change the text color to green. I already have 3 allowable conditional formats in place so I need to write two more macros so I cover all 5 scenarios. Thanks, BearsFan |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
'-----------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range) '----------------------------------------------------------------- Const WS_RANGE As String = "B7:B175" On Error GoTo ws_exit: Application.EnableEvents = False If Not Intersect(Target, Me.Range(WS_RANGE)) Is Nothing Then With Target Select Case .Value Case "Completed": .Interior.ColorIndex = 10 'green 'etc. End Select End With End If ws_exit: Application.EnableEvents = True End Sub 'This is worksheet event code, which means that it needs to be 'placed in the appropriate worksheet code module, not a standard 'code module. To do this, right-click on the sheet tab, select 'the View Code option from the menu, and paste the code in. -- HTH Bob Phillips (replace xxxx in the email address with gmail if mailing direct) "bearsfan" wrote in message ... -Hello, What is the macro for changing the font color in a specific range based on the text entered? For instance, if user types in "Completed" into any cell in range B7:B175 the cell with completed should change the text color to green. I already have 3 allowable conditional formats in place so I need to write two more macros so I cover all 5 scenarios. Thanks, BearsFan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Font color changing by itself | Excel Discussion (Misc queries) | |||
Changing Font color based on font type or size | Excel Discussion (Misc queries) | |||
Changing Font Color | Excel Discussion (Misc queries) | |||
Changing the font color using VBA | Excel Programming | |||
Changing Font Color | Excel Programming |