Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to change font color on string/text values

I have cells with titles in which some words are black, others are
red/
struck through, and other words are blue.

For every cell that has blue words, I want to convert those words to
green. All other words in the string should remain, as is.

Any ideas? I tried this conditional formatting:

Cell Value is EQUAL TO = "vbBlue" [format..] then I clicked a green
color.

Thanks!
Dan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to change font color on string/text values

Something like this should work...

Sub RecolorText()
Dim X As Long
Dim C As Range
For Each C In Worksheets("Sheet1").Range("A1:F1")
If Len(C.Value) 0 Then
For X = 1 To Len(C.Value)
If C.Cells.Characters(X, 1).Font.Color = vbBlue Then
C.Cells.Characters(X, 1).Font.Color = vbGreen
End If
Next
End If
Next
End Sub

Just change the worksheet and range in the For Each statement to what you
need.

Rick


wrote in message
...
I have cells with titles in which some words are black, others are
red/
struck through, and other words are blue.

For every cell that has blue words, I want to convert those words to
green. All other words in the string should remain, as is.

Any ideas? I tried this conditional formatting:

Cell Value is EQUAL TO = "vbBlue" [format..] then I clicked a green
color.

Thanks!
Dan


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How to change font color on string/text values

On Mar 26, 4:16 pm, "Rick Rothstein \(MVP - VB\)"
wrote:
Something like this should work...

Sub RecolorText()
Dim X As Long
Dim C As Range
For Each C In Worksheets("Sheet1").Range("A1:F1")
If Len(C.Value) 0 Then
For X = 1 To Len(C.Value)
If C.Cells.Characters(X, 1).Font.Color = vbBlue Then
C.Cells.Characters(X, 1).Font.Color = vbGreen
End If
Next
End If
Next
End Sub

Just change the worksheet and range in the For Each statement to what you
need.

Rick

wrote in message

...

I have cells with titles in which some words are black, others are
red/
struck through, and other words are blue.


For every cell that has blue words, I want to convert those words to
green. All other words in the string should remain, as is.


Any ideas? I tried this conditional formatting:


Cell Value is EQUAL TO = "vbBlue" [format..] then I clicked a green
color.


Thanks!
Dan


Wow.

That worked wonders.

Thanks, Rick!
Reply
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
How do I change Font color specific text jlr Excel Discussion (Misc queries) 1 May 6th 10 08:19 PM
String Font Color VBA [email protected] Excel Programming 4 May 27th 07 03:13 PM
Search for text, change font color John[_108_] Excel Programming 2 July 8th 05 02:52 PM
Excel should allow me to change text color & font within tabs. hw Excel Discussion (Misc queries) 1 February 17th 05 10:52 PM
How can I automatically change the font color of text in cells th. les Excel Discussion (Misc queries) 1 January 4th 05 03:06 AM


All times are GMT +1. The time now is 03:11 AM.

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

About Us

"It's about Microsoft Excel"