I'm just trying to help a user colour various cells using the simple
because he wants to be able to do a conditional sum of these cells.
I've recorded a macro based on the SUMIF function
using the above logic but it just returns a 0 although it puts the following formula into the cell I7,
=SUMIF(H18:H20,"Interior.ColorIndex = 3")
I've had a quick look in the forum but can't see that anyone has done this; surely someone has! I can only assume that there's a difference between what VBA calls a cell colour and what Excel does.
Hope someone can assist. Many thanks, Des.
P.S. Hope no-one's upset by the English spelling of colour! LOL!!
Code:
Sub TestColourShading()
Selection.Interior.ColorIndex = 3
End Sub
I've recorded a macro based on the SUMIF function
Code:
ActiveCell.FormulaR1C1 = _
"=SUMIF(R[1]C[-1]:R[3]C[-1],""Interior.ColorIndex = 3"")"
using the above logic but it just returns a 0 although it puts the following formula into the cell I7,
=SUMIF(H18:H20,"Interior.ColorIndex = 3")
I've had a quick look in the forum but can't see that anyone has done this; surely someone has! I can only assume that there's a difference between what VBA calls a cell colour and what Excel does.
Hope someone can assist. Many thanks, Des.
P.S. Hope no-one's upset by the English spelling of colour! LOL!!