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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

count only coloured numbers 2

Status
Not open for further replies.

leehale

Technical User
Jun 17, 2002
54
GB
I need to count only the coloured numbers in a list only for example below.

1
5 RED FONT
8
9 RED FONT
7
5
Total 14

Counting only the red numbers. There could be more than one colour to count separately!! HELP
 
leehale,
you need to set up vars, go through each cell and see the
Code:
ActiveCell.Font.ColorIndex
then add the value of the cell based on the color to the proper var.
if you are not sure what the color indexs are use
Code:
msgbox (ActiveCell.Font.ColorIndex)
when in the cell to display it.
regards,
longhair
 
can't be done without VBA. This is one of the most common misconceptions regarding excel. It does not provide ANY native functionality to analyse anything by colour.

If the colours were set based on certain criteria then you can replicate that criteria and count based on that but otherwise, as I said, you would need to use VBA

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Thank you guys it looks like I will try the VBA approach then. Thanks again.
 
It's pretty straightforward if you can code VBA - post in the VBA Forum (Forum707) and I'm sure someone (or me) will be able to help out

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
My VBA is like a church mouse. poor. I will look in the other forum Monday. Thanks again.

Lee
 
Given the frequency of this request, I have created a FAQ for it in the VBA forum - it will need to be approved by site management but should be in place by tomorrow afternoon (UK time)

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Hi Geoff, does it mention that you cannot capture coloured numbers where the colouring has been done by conditional formatting? Or at least not without an awful lot of faffing around obtaining conditions and then checking for conditions being true etc.

Regards
Ken.........

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]
----------------------------------------------------------------------------
 
oooops - forgot about that one [blush]

Will add a note

Cheers Ken

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
:)

----------------------------------------------------------------------------
[peace]It's easier to beg forgiveness than ask permission[2thumbsup]
----------------------------------------------------------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top