Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2006

Tip: Looking for answers? Try searching our database.

Changing font colors...

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JoAnn Paules [MVP] - 29 Nov 2006 00:40 GMT
Normally changing the font color is a simple task, right? Well, I've got a
poser for y'all. (Excel 2003, Win 2000, fully patched)

My boss keeps a spreadsheet of issues/resolutions on the tanks (vehicles,
not vessels) at work. Each row is a separate vehicle. One of the columns has
multiple lines of text with manual line breaks between each issue. If an
issue hasn't been discussed at our 3x weekly meeting, that specific line of
text is changed to green. After it's discussed, it's changed to black. Got
this so far?

Okay..........we use a projector in the 3x weekly meeting to display this
spreadsheet. The colors are muddied so I've changed that green text to
bright green so it is obviously not black on the projection screen. I have
been trying to use Find/Replace to find any green text and change it to
bright green. Unfortunately, it will not hit on any cells that doesn't
contain text in mixed colors. It's an all or nothing. I've tried selecting
the "Match entire cell contents" and deselecting it. No difference.

It's difficult to see the green text and I would love to be able to do
something simple like this to change it all in one shot. Can it be done? Can
it be done by someone who knows diddly about VBA?

Signature

JoAnn Paules
MVP Microsoft [Publisher]

~~~~~
How to ask a question
http://support.microsoft.com/KB/555375

Jim Cone - 29 Nov 2006 05:15 GMT
JoAnn,
It sound like you have already changed the colors in the cells
where every character is already green.  That would leave the
cells with two or more font colors in them.
Vba code could go thru the used range on the sheet and determine
each cell with mixed font colors.   Then for each of those cells
it would have to read the font color for each character and if it
was dark green in color then change it to bright green.
Or it could just look for any character that wasn't colored "automatic"
and change it to bright green.
If you have 10,000 tanks and a small book written about each one
then the procedure would probably take a while.
Does that describe the situation and/or help clarify it?
Signature

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware

"JoAnn Paules [MVP]" <jl_paules@hotNOSPAMmail.com>
wrote in message
Normally changing the font color is a simple task, right? Well, I've got a
poser for y'all. (Excel 2003, Win 2000, fully patched)

My boss keeps a spreadsheet of issues/resolutions on the tanks (vehicles,
not vessels) at work. Each row is a separate vehicle. One of the columns has
multiple lines of text with manual line breaks between each issue. If an
issue hasn't been discussed at our 3x weekly meeting, that specific line of
text is changed to green. After it's discussed, it's changed to black. Got
this so far?

Okay..........we use a projector in the 3x weekly meeting to display this
spreadsheet. The colors are muddied so I've changed that green text to
bright green so it is obviously not black on the projection screen. I have
been trying to use Find/Replace to find any green text and change it to
bright green. Unfortunately, it will not hit on any cells that doesn't
contain text in mixed colors. It's an all or nothing. I've tried selecting
the "Match entire cell contents" and deselecting it. No difference.

It's difficult to see the green text and I would love to be able to do
something simple like this to change it all in one shot. Can it be done? Can
it be done by someone who knows diddly about VBA?

--

JoAnn Paules
MVP Microsoft [Publisher]

~~~~~
How to ask a question
http://support.microsoft.com/KB/555375

Bob Phillips - 29 Nov 2006 08:59 GMT
This code should so it, but as Jim says, it could take a long time

Public Sub ProcessData()
Const TestColumn As String = "D"    '<=== change to suit
Const OriginalCI As Long = 10       '<=== green, change to suit
Const NewCI As Long = 4             '<=== lime green, change to suit
Dim iLastRow As Long
Dim i As Long, j As Long
   With ActiveSheet

       Application.ScreenUpdating = False
       Application.Calculation = xlCalculationManual

       iLastRow = .Cells(.Rows.Count, TestColumn).End(xlUp).Row
       For i = 1 To iLastRow
           For j = 1 To Len(Cells(i, TestColumn).Value)
               Debug.Print
               If Cells(i, TestColumn).Characters(j, 1).Font.ColorIndex =
OriginalCI Then
                   Cells(i, TestColumn).Characters(j, 1).Font.ColorIndex =
NewCI
               End If
           Next j
       Next i

       Application.Calculation = xlCalculationAutomatic
       Application.ScreenUpdating = True

   End With

End Sub

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

> Normally changing the font color is a simple task, right? Well, I've got a
> poser for y'all. (Excel 2003, Win 2000, fully patched)
[quoted text clipped - 26 lines]
> How to ask a question
> http://support.microsoft.com/KB/555375
JoAnn Paules [MVP] - 29 Nov 2006 11:23 GMT
You guys understand the problem perfectly. It's not a huge spreadsheet.
Maybe 200 rows and the font in question is all in one column.

I'll try the code but I've never had much luck at running codes. I'm a
complete dunce with them.

Signature

JoAnn Paules
MVP Microsoft [Publisher]

~~~~~
How to ask a question
http://support.microsoft.com/KB/555375

> This code should so it, but as Jim says, it could take a long time
>
[quoted text clipped - 73 lines]
>> How to ask a question
>> http://support.microsoft.com/KB/555375
Bob Phillips - 29 Nov 2006 14:04 GMT
Just select the sheet in question, then go into the VBIDE (Alt-F11).

In the VBIDE, insert a code module (Insert>Module)

Paste the code into the code pane.

Make changes to the customisable bits that I indicated.

Put the cursor somewhere in the code, anywhere, then hit F5 to run it.

Go back to Excel to check the results.

--

HTH

Bob Phillips

(replace xxxx in the email address with gmail if mailing direct)

> You guys understand the problem perfectly. It's not a huge spreadsheet.
> Maybe 200 rows and the font in question is all in one column.
[quoted text clipped - 88 lines]
> >> How to ask a question
> >> http://support.microsoft.com/KB/555375
JoAnn Paules [MVP] - 01 Dec 2006 00:07 GMT
TA DUM!!! Give the man a see-gar!

Yes, the font changed colors. Plus I edited that code to change it back
again. The lime green shows up great on a projected image but it difficult
to see on a CRT monitor. This way I can change the text prior to our meeting
and then back again afterward.

Thank you ever so much. I actually stopped at Borders on the way home from
work and picked up "Excel VBA Programming for Dummies". "Excel Programming
for Drooling Imbeciles" would have been better for me but it doesn't exist.
Let's hope I'm a dummy.  ;-)

Signature

JoAnn Paules
MVP Microsoft [Publisher]

~~~~~
How to ask a question
http://support.microsoft.com/KB/555375

> Just select the sheet in question, then go into the VBIDE (Alt-F11).
>
[quoted text clipped - 119 lines]
>> >> How to ask a question
>> >> http://support.microsoft.com/KB/555375

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.