Excel Conditional Cell Formatting

Closed
Nancy - Oct 11, 2009 at 05:52 PM
 Aphelion - Oct 23, 2009 at 05:10 AM
Hello,

I need an MS Office Excel 2007 formula. I want to fill multiple cells in a row with color IF one particular cell in the row is divisible by 5. The particular cell with the number in it contains a formula (example: =$C$1-C65)

Thanks for any help you can give.

Nancy
Related:

1 response

venkat1926 Posts 1863 Registration date Sunday June 14, 2009 Status Contributor Last seen August 7, 2021 811
Oct 11, 2009 at 11:25 PM
the cdoe will be something like this (modify to suit you)

Sub test()
Dim r As Range, c As Range
Set r = Range("c1:c65")
For Each c In r

If c Mod 5 = 0 Then c.EntireRow.Interior.ColorIndex = 3
Next c

End Sub
3
Thank you for your reply. It is still way over my head, though. Would it be possible to dumb it down? What, exactly, would I put in the cell? Where do I enter the formula? Where do I set the range?

Thanks...
0
Aphelion > Nancy
Oct 23, 2009 at 05:10 AM
The script above is actually a VBA script.
Access VBA by using ALT+F11 while in Excel.
0