Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Formula

Status
Not open for further replies.

demon147

Technical User
Jun 29, 2001
30
CA
Is there a formula in excel to total a range of cells only if the font color is red.

Help Appreciated,
Thanks,
George
 
Put your list of choices on THIS worksheet in a column, perhaps off to the right where it won't normally be seen.

Click on cell where you want the dropdown to appear. Hit Data-Validation and choose List. Click on the fill-in box icon, choose your list, click the icon again.

You will only see the dropdown arrow when that cell has focus.

techsupportgirl@home.com
Brainbench MVP for Microsoft Word
 
I not aware of a formula that can do this. However, this bit of VB will do the trick.

Sub SumByFontColor()
' Requires a range to be selected ahead of time, font color must equal 3 (red)
Set MyRange = Selection
For Each MyCell In MyRange
If MyCell.Font.ColorIndex = 3 Then MyTotal = MyTotal + MyCell.Value
Next

MsgBox MyTotal

' Alternatively the total may be stored in Cell A1
' ActiveSheet.Rows(1).Columns(1) = MyTotal

End Sub
 
Honestly, I read it and read it again and I thought it would be great, sounds so easy . . . wait a minute. That doesn't total anything!

Just keeping everyone on their toes!

I'm outta here.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top