Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I've a simple function, copied from various examples on the net, to sum
numbers based on the color of another cell. I want change the active cell color but it doesn't seem to work. Any suggestions, any help appreciated, code is as follows... Function ColorSum(cRefColor, rRange) Dim r As Range Dim iColorIndex As Integer ColorSum = 0 iColorIndex = cRefColor.Font.ColorIndex 'build formula for range For Each C1 In rRange.Cells If C1.Font.ColorIndex = iColorIndex Then ColorSum = ColorSum + C1.Value Else C1.Font.ColorIndex = iColorIndex End If Next 'this doesn't work! ActiveCell.Font.ColorIndex = iColorIndex End Function |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
If activecell.column = variable then activecell,offset (0,1) | Excel Discussion (Misc queries) | |||
Cell background color (interior color) setting not working | Excel Programming | |||
Setting Background Color RGB (Always goes to closest index color) | Excel Programming | |||
setting range from activecell in macro | Excel Programming | |||
activecell color | Excel Programming |