conditional formating?

  • Thread starter Thread starter marcus
  • Start date Start date
M

marcus

I have this little problem:
I'm entering numbers in row B
A1 sums them
what do I have to do to sum the numbers in B1, only if they colored
red
but at the same time they have to be summed in A1
In other words all the numbers are summed in A1 but only red in B1
can anybody help me with this, please

Marcus
 
I have this little problem:
I'm entering numbers in row B
A1 sums them
what do I have to do to sum the numbers in B1, only if they colored
red
but at the same time they have to be summed in A1
In other words all the numbers are summed in A1 but only red in B1
can anybody help me with this, please

Marcus

Ooops, one more thing:
what do I do if I just want to count how many times red number shows
up in row 2 (not to add them up) and the result go to B1
(of course I meant row 2 not row B)

Marcus
 
Hi Marcus,

See the previously suggested page which includes instructions for both
summing and counting by colour.
 
first I thought it was the formula I have to use in B1, but it gives
me error (I think it does not recognize colourindex function) so I
scrolled down that page and see there is some vba code which gives me
trouble to understand or modify because I don't know vba at all
the way I understand it is:
vba code is there so when I enter the formula in certain cell
"colourindex" function will be recognizable by Excel
I tried to do it, but it does not work, maybe I would have to modify
the code somehow, but like I said, I'm afraid to touch it
Marcus
 
Hi Marcus,

You need to copy the function to a standard code module:

Alt-F11 to open the VBE (Visual Basic Editor)
Insert | Module
Paste the code
Alt-F11 to return to Excel.

As you are new to VBA, you may wish to visit David McRitchie's 'Getting
Started With Macros And User Defined Functions' at:

http://www.mvps.org/dmcritchie/excel/getstarted.htm
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top