We'd like to remind Forumites to please avoid political debate on the Forum... Read More »
We're aware that some users are experiencing technical issues which the team are working to resolve. See the Community Noticeboard for more info. Thank you for your patience.
📨 Have you signed up to the Forum's new Email Digest yet? Get a selection of trending threads sent straight to your inbox daily, weekly or monthly!
Colour coding text in Excel
Options

cwoodham
Posts: 432 Forumite
in Techie Stuff
I wonder if anyone can help on this. I'm trying to colour code text in a column so that when I enter say a three letter text string in a cell Excel automatically gives it a predefined colour.
I've tried conditional formatting and can get three colours this way plus the plain black for text which is not formatted, i.e. four colours in total. But I need up to 10 colours.
Is there any way to do this? Maybe there's an online resource which explains it. I tried a Google search and couldn't find anything. I'm little more than a novice with Excel so please explain in simple terms.
Thanks in advance.
I've tried conditional formatting and can get three colours this way plus the plain black for text which is not formatted, i.e. four colours in total. But I need up to 10 colours.
Is there any way to do this? Maybe there's an online resource which explains it. I tried a Google search and couldn't find anything. I'm little more than a novice with Excel so please explain in simple terms.
Thanks in advance.
0
Comments
-
just looked at my excel and conditional formatting allows me to use the whole colour palette.
what version excel you got ? I have 2000.Karma is a wonderful thing.0 -
I seem to remember away of doing this advertised on the ozgrid.com website a couple of months back
HTH0 -
sorry - just checked again. I realise the limitation is that excel only allows each cell to have up to 3 conditions set.Karma is a wonderful thing.0
-
johnnyb, I've Excel 2000. I can select from the whole palette okay, its just that conditional formatting only seems to allow three 'picks' from the palette.0
-
AndyRat: Thanks. I went to the ozgrid.com website and got some help here
http://www.ozgrid.com/VBA/excel-conditional-formatting-limit.htm
I copied the VBA code into the codes window of the worksheet as instructed and put in the text I wanted instead of Case and I was able to change the cell background colours conditionally, which is a good result!
I guess if I knew more about VBA I could change the font colours but this will do in the meantime.0 -
You're nearly there, a quick search on google for "Excel VBA font colour" returned a number of pages, the second one said this...
"ActiveCell.Font.Color = RGB(255,0,0)
sets the active cells font colour to Red (255 red, 0 green, 0 blue). Alternatively, you can use the ColorIndex property. This lets you specify an item in the workbooks palette (this can be set in the Color tab of the Excel Options dialog).
ActiveCell.Font.ColorIndex = 16
sets the font colour to the 16th item on the colour palette."
So you're looking at replacing interior.colorIndex with font.colorIndex
(or you can use RGB values with the first string)
Hope this sorts your problem
E.M.0 -
cwoodham wrote:I guess if I knew more about VBA I could change the font colours but this will do in the meantime.0
This discussion has been closed.
Confirm your email address to Create Threads and Reply

Categories
- All Categories
- 351K Banking & Borrowing
- 253.1K Reduce Debt & Boost Income
- 453.6K Spending & Discounts
- 244K Work, Benefits & Business
- 598.9K Mortgages, Homes & Bills
- 176.9K Life & Family
- 257.3K Travel & Transport
- 1.5M Hobbies & Leisure
- 16.1K Discuss & Feedback
- 37.6K Read-Only Boards