Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 2
Default how to count number of highlighted cells in column

Within an existing worksheet I have a column of data containing cells that
are either highlighted in yellow (manually highlighted) or not highlighted in
yellow. I need to sum how many cells are highlighted in yellow and how many
cells are not highlighted in yellow. I'm running MS Office Excel 2003 SP2.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default how to count number of highlighted cells in column

You're going to have to use some VBA.

Chip Pearson explains it:
http://cpearson.com/excel/colors.htm

As alternative.
Add an extra column and put an indicator in that column (X). Then use
format|Conditional formatting to make it look pretty. But use that indicator
column in you calculations (=countif() or = sumif() or ...).

Mike K wrote:

Within an existing worksheet I have a column of data containing cells that
are either highlighted in yellow (manually highlighted) or not highlighted in
yellow. I need to sum how many cells are highlighted in yellow and how many
cells are not highlighted in yellow. I'm running MS Office Excel 2003 SP2.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 527
Default how to count number of highlighted cells in column

Mike

With xl2003 it has to be done with VB. Here's one way, you have to select
the range then run it.

Sub TestColor()
Application.ScreenUpdating = False
x = Selection.Cells.Count
For Each c In Selection
c.Select
If Selection.Interior.ColorIndex = 6 Then
Count = Count + 1
End If
Next
Application.ScreenUpdating = True
MsgBox Count & " coloured cells"
MsgBox x - Count & " Non coloured Cells"
End Sub

Regards
Peter

"Mike K" wrote:

Within an existing worksheet I have a column of data containing cells that
are either highlighted in yellow (manually highlighted) or not highlighted in
yellow. I need to sum how many cells are highlighted in yellow and how many
cells are not highlighted in yellow. I'm running MS Office Excel 2003 SP2.

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 104
Default how to count number of highlighted cells in column

Billy, this worked perfectly! Much appreciated!!!

"Billy Liddel" wrote:

Mike

With xl2003 it has to be done with VB. Here's one way, you have to select
the range then run it.

Sub TestColor()
Application.ScreenUpdating = False
x = Selection.Cells.Count
For Each c In Selection
c.Select
If Selection.Interior.ColorIndex = 6 Then
Count = Count + 1
End If
Next
Application.ScreenUpdating = True
MsgBox Count & " coloured cells"
MsgBox x - Count & " Non coloured Cells"
End Sub

Regards
Peter

"Mike K" wrote:

Within an existing worksheet I have a column of data containing cells that
are either highlighted in yellow (manually highlighted) or not highlighted in
yellow. I need to sum how many cells are highlighted in yellow and how many
cells are not highlighted in yellow. I'm running MS Office Excel 2003 SP2.

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 527
Default how to count number of highlighted cells in column

Mike

You're welcome. Thanks for the feedback and rating.

Regards
Peter

"Mike K" wrote:

Billy, this worked perfectly! Much appreciated!!!

"Billy Liddel" wrote:

Mike

With xl2003 it has to be done with VB. Here's one way, you have to select
the range then run it.

Sub TestColor()
Application.ScreenUpdating = False
x = Selection.Cells.Count
For Each c In Selection
c.Select
If Selection.Interior.ColorIndex = 6 Then
Count = Count + 1
End If
Next
Application.ScreenUpdating = True
MsgBox Count & " coloured cells"
MsgBox x - Count & " Non coloured Cells"
End Sub

Regards
Peter

"Mike K" wrote:

Within an existing worksheet I have a column of data containing cells that
are either highlighted in yellow (manually highlighted) or not highlighted in
yellow. I need to sum how many cells are highlighted in yellow and how many
cells are not highlighted in yellow. I'm running MS Office Excel 2003 SP2.



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default how to count number of highlighted cells in column

Mike

Without using VBA..........

Select the entire range of colored/non-colored cells.

EditFindOptionsFormat. Click the dropdown arrow and hit Format.

Select the yellow color from the patterns dialog and OK.

Then Find All.

The first yellow cell will be highlighted in the Find dialog.

Scroll down to bottom and hit Shift + click to select all in dialog box.

In the status bar right-click and select Count.


Gord Dibben MS Excel MVP

On Tue, 8 May 2007 12:38:00 -0700, Mike K <Mike
wrote:

Within an existing worksheet I have a column of data containing cells that
are either highlighted in yellow (manually highlighted) or not highlighted in
yellow. I need to sum how many cells are highlighted in yellow and how many
cells are not highlighted in yellow. I'm running MS Office Excel 2003 SP2.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can you count the number of cells that are highlighted in a column Mike Excel Worksheet Functions 1 October 13th 06 07:59 PM
How do I automatically count the number of cells highlighted Ferd Excel Discussion (Misc queries) 2 September 10th 06 07:00 AM
How do I automatically count the number of cells highlighted Ferd Excel Discussion (Misc queries) 1 July 7th 06 09:38 AM
Is there a way to count the number of highlighted cells in a col? Alicia Excel Discussion (Misc queries) 2 February 23rd 06 05:52 PM
Count highlighted cells Robbie in Houston Excel Worksheet Functions 2 February 16th 05 12:52 AM


All times are GMT +1. The time now is 11:00 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"