Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a range (I'm calling it r) that refers to a cell. I've found that
the cell has multiple colorindeces. How do I extract the characters where the color index is RED only. Thanks, Barb Reinhardt |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This should work:
For Each Character in Range(r).Characters If Font.ColorIndex = 3 Then 'Do Something End If Next "Barb Reinhardt" wrote: I have a range (I'm calling it r) that refers to a cell. I've found that the cell has multiple colorindeces. How do I extract the characters where the color index is RED only. Thanks, Barb Reinhardt |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Of course, if the r already = Range("?") then it would be r.Characters.
"Barb Reinhardt" wrote: I have a range (I'm calling it r) that refers to a cell. I've found that the cell has multiple colorindeces. How do I extract the characters where the color index is RED only. Thanks, Barb Reinhardt |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Barb Reinhardt" wrote: I have a range (I'm calling it r) that refers to a cell. I've found that the cell has multiple colorindeces. How do I extract the characters where the color index is RED only. Thanks, Barb Reinhardt As a function: Function GetRed(rng As Range) As String Dim r As String, i As Long r = "" For i = 1 To Len(rng.Value) If rng.Characters(i, 1).Font.ColorIndex = 3 Then r = r & rng.Characters(i, 1).Text End If Next i GetRed = r End Function Tim |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional Format for font color using font color | Excel Worksheet Functions | |||
Changing Font color based on font type or size | Excel Discussion (Misc queries) | |||
Check Font or Font color and take action | Excel Programming | |||
change font color if number Range changes | Excel Worksheet Functions | |||
Change color of font base on time range | Excel Discussion (Misc queries) |