WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

How do I add together only cells formatted in the same col..

 
   Home -> Office -> General Discussions RSS
Next:  excel trying to open word document  
Author Message
Fizz Richardson

External


Since: Apr 19, 2007
Posts: 6



(Msg. 1) Posted: Thu Apr 19, 2007 4:34 am
Post subject: How do I add together only cells formatted in the same colour?
Archived from groups: microsoft>public>excel>misc (more info?)

I have a budget spreadsheet with actual YTD, current orders & forecast sales
each are formatted in a different colour. I know there is a way to add
together only the cells formatted in a colour, but how is it done? Does the
formatting have to be a fill colour or - as I have - a text colour??

many thanks
Back to top
Login to vote
JMay

External


Since: May 03, 2006
Posts: 132



(Msg. 2) Posted: Thu Apr 19, 2007 4:54 am
Post subject: RE: How do I add together only cells formatted in the same colour? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

http://www.cpearson.com/excel/colors.htm

"Fizz Richardson" wrote:

> I have a budget spreadsheet with actual YTD, current orders & forecast sales
> each are formatted in a different colour. I know there is a way to add
> together only the cells formatted in a colour, but how is it done? Does the
> formatting have to be a fill colour or - as I have - a text colour??
>
> many thanks
Back to top
Login to vote
Mike

External


Since: Mar 10, 2006
Posts: 1119



(Msg. 3) Posted: Thu Apr 19, 2007 4:58 am
Post subject: RE: How do I add together only cells formatted in the same colour? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Alt+F11 and paste this function into a workbook module

Function redcells(SelectedCells As Range)
Dim Cell As Object
Dim x As Double
x = 0
For Each Cell In SelectedCells
If Cell.Font.ColorIndex = 3 Then '< 3=red change as required
x = x + Cell.Value
End If
Next Cell
redcells = x
End Function

in a cell call the function with =redcells(A1:a100)

Mike

"Fizz Richardson" wrote:

> I have a budget spreadsheet with actual YTD, current orders & forecast sales
> each are formatted in a different colour. I know there is a way to add
> together only the cells formatted in a colour, but how is it done? Does the
> formatting have to be a fill colour or - as I have - a text colour??
>
> many thanks
Back to top
Login to vote
Fizz Richardson

External


Since: Apr 19, 2007
Posts: 6



(Msg. 4) Posted: Thu Apr 19, 2007 6:10 am
Post subject: RE: How do I add together only cells formatted in the same colour? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thanks for coming back - I used to be able to write macros in early Excel,
but have never got to grips with visual basic. I have copied this as per
your note but, tp be honest, am a bit lost thereafter, so I shall have to go
and look at the Visual Basic stuff to work out if this answers my oroginal
problem.

Many thanks

Fizz Richardson

"Mike" wrote:

> Alt+F11 and paste this function into a workbook module
>
> Function redcells(SelectedCells As Range)
> Dim Cell As Object
> Dim x As Double
> x = 0
> For Each Cell In SelectedCells
> If Cell.Font.ColorIndex = 3 Then '< 3=red change as required
> x = x + Cell.Value
> End If
> Next Cell
> redcells = x
> End Function
>
> in a cell call the function with =redcells(A1:a100)
>
> Mike
>
> "Fizz Richardson" wrote:
>
> > I have a budget spreadsheet with actual YTD, current orders & forecast sales
> > each are formatted in a different colour. I know there is a way to add
> > together only the cells formatted in a colour, but how is it done? Does the
> > formatting have to be a fill colour or - as I have - a text colour??
> >
> > many thanks
Back to top
Login to vote
Fizz Richardson

External


Since: Apr 19, 2007
Posts: 6



(Msg. 5) Posted: Thu Apr 19, 2007 6:14 am
Post subject: RE: How do I add together only cells formatted in the same colour? [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Thank you for the link - it fills in some of the Visual Basic gaps (great
holes rather) in my knowledge and now I can go and get this working rather
than selecting each cell individually to add them together as I have been
doing

Thanks

Fizz Richardson
"JMay" wrote:

> http://www.cpearson.com/excel/colors.htm
>
> "Fizz Richardson" wrote:
>
> > I have a budget spreadsheet with actual YTD, current orders & forecast sales
> > each are formatted in a different colour. I know there is a way to add
> > together only the cells formatted in a colour, but how is it done? Does the
> > formatting have to be a fill colour or - as I have - a text colour??
> >
> > many thanks
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> General Discussions All times are: Eastern Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET