The old conditional formatting question again...

Swanky

Board Regular
Joined
Jun 3, 2004
Messages
70
Sorry gang, same old question again, I have searched, but the searches haven't explained anything to me really, and I don't just want to copy and paste something for the sake of it, I actually would like to learn something from it too!

OK, I'm stuck with the same old problem, want conditional formatting but have more than 3 conditions, so I need some code.

I am tracking how many different type trades people I have on a project.
Those positions are:

Fitter = Yellow
Boilermaker = Blue
Rigger = Purple
TA = Buff (Light yellow)
Team Leader = Burgundy

Now what I need to know is the code for this, but I also wnat to know where the colours are in the code.
is there a colour chart?
If I don't like the colours, I need to know how to change the code to get the colours I'm after.
Also if I have code already in a spread sheet, how do I add new code, with out destroying the new code.

I realise this is kinda newbie questions, but it may just help me to learn.

Thanks in advance guys!
:D
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Try this code (paste into a standard module) in a NEW workbook. It should produce what you want/need. You could use the Select Case approach to get your final Color
selection

Sub RunColorIndex()
Dim i As Integer
Range("A1").Select
For i = 1 To 48
With ActiveCell
.Interior.ColorIndex = i
.Value = i
.HorizontalAlignment = xlCenter
End With
ActiveCell.Offset(1).Select
Next i
End Sub

Post Back with questions
 
Upvote 0
Thanks for the help Jim.
The questions are many now.

I have pasted your code into a new work book.
But please forgive my ignorance, I'm not sure how it works now.
All of my positions are are going to be placed in collum "D".
So hpw does your code make my cell change to the appropriate colour when I type in the job role.
EG: what do I now need to do to make the cell turn yellow when I type in Fitter.

Normally I would just use the conditional formatting tool, so I never have problems, but I also want to understand the code, or at least understand what I'm telling Excel to do.

Thanks for your help and patience.
 
Upvote 0
It's always best if you post your existing code -- can you do so?
Hi Jim, at this stage I do not have any code.

I was hoping it would be something simple to make code for the conditional format.
I know it's been covered here, before, but I would like the code for this simple task, then for someone to hopefully explain some of it's basics, in order that I might be able to learn from it.

Cheers.
 
Upvote 0
Swanky;
In Column D - Do you wish that the Cells interior (background) colors take on these colors, or do you wish for the Font color of each of your occupations to be the color?
 
Upvote 0

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top