i need help on a program i am writing
On Sep 27, 10:28*pm, ShaneDevenshire
wrote:
Hi,
Here is some sample code
Sub ColorCells()
* * Dim cell As Range
* * For Each cell In Selection
* * * * With Range(cell, cell.Offset(0, 13)).Interior
* * * * * * Select Case cell
* * * * * * * * Case "pending"
* * * * * * * * * * .ColorIndex = 6
* * * * * * * * Case "yes"
* * * * * * * * * * .ColorIndex = 2
* * * * * * * * Case "e"
* * * * * * * * * * .ColorIndex = 3
* * * * * * * * Case Is < "pending"
* * * * * * * * * * .ColorIndex = 50
* * * * * * End Select
* * * * End With
* * Next cell
End Sub
In addition to what I stated befo
1. *setting a cell to white is different than not filling it with a color
2. *this macro will color blank cells because they are < pending
3. *as written this code is case insensitive, if this is not what you want
you need to modify the code
To run this macro just select the cells in column A that you want to test
and choose Tools, Macro, Macros, pick the macro and click Run.
--
Thanks,
Shane Devenshire
"exor" wrote:
I need to know how I can change the fill color of a range.
Now that is the simple part.
But I need to make a function so that it can be changed by two
different cells.
One cell will change it one color the other cell will change it
another color.
Example: in row three cell a3 has the word "pending"(pending can be in
ne row) in it. Since a3 = pending the color of the row (range from a3
to q3) is yellow (row).
If a3 < "pending" its white (row) also if a3 = e or d color the row
(range from a3 to q3) red (row)
Now if c3 = "yes" then change the row (range from a3 to q3) color to
green if it is no leave row alone.
Also this can happen in ne row so and must be row specific.
i can make it it hapen but not be row specific
i could use ne help please.
thanks
exor- Hide quoted text -
- Show quoted text -
thank you shane
it show me alot i can mod this to what i need.
|