Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
demon42
 
Posts: n/a
Default Counting shaded cells


I have a very large excel table that my lab uses for test results. A
good portion of the table has been grayed out for various hardware
reasons. I would like to be able to count the number of shaded cells in
the table to get a completion percentage, and im not sure how (is there
a way? ) withouth manually counting them myself which would
be tremendously tedious.

I am running Excel 2000, but if it made a difference I could upgrade
without a problem if needed.

I have a feeling this might have to be a VB script...

Thank you in advance!


--
demon42
------------------------------------------------------------------------
demon42's Profile: http://www.excelforum.com/member.php...o&userid=27448
View this thread: http://www.excelforum.com/showthread...hreadid=469554

  #2   Report Post  
Gary''s Student
 
Posts: n/a
Default

Let's assume that shaded means that the background color index = 48. First
select a pile of cells and then run:

Sub shady()
Dim r As Range
Dim IAmTheCount As Long
Dim j As Integer
IAmTheCount = 0
For Each r In Selection
j = r.Interior.ColorIndex
If j = 48 Then
IAmTheCount = IAmTheCount + 1
End If
Next
MsgBox IAmTheCount
End Sub
--
Gary''s Student


"demon42" wrote:


I have a very large excel table that my lab uses for test results. A
good portion of the table has been grayed out for various hardware
reasons. I would like to be able to count the number of shaded cells in
the table to get a completion percentage, and im not sure how (is there
a way? ) withouth manually counting them myself which would
be tremendously tedious.

I am running Excel 2000, but if it made a difference I could upgrade
without a problem if needed.

I have a feeling this might have to be a VB script...

Thank you in advance!


--
demon42
------------------------------------------------------------------------
demon42's Profile: http://www.excelforum.com/member.php...o&userid=27448
View this thread: http://www.excelforum.com/showthread...hreadid=469554


  #3   Report Post  
demon42
 
Posts: n/a
Default


Thank you for your help!
Through another forum i frequent, someone found 'this article'
(http://www.cpearson.com/excel/colors.htm) for me and it works great.
Thank you very much anyway, I greatly appreciate it!


--
demon42
------------------------------------------------------------------------
demon42's Profile: http://www.excelforum.com/member.php...o&userid=27448
View this thread: http://www.excelforum.com/showthread...hreadid=469554

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
Shaded cells won't print shaded Linda C Excel Worksheet Functions 4 April 3rd 23 06:59 PM
Counting coloured cells amvena Excel Discussion (Misc queries) 2 August 19th 05 02:40 PM
Counting cells in Excel? Kelly Lim Excel Discussion (Misc queries) 25 June 2nd 05 09:37 AM
Counting only active cells Sac73 Excel Discussion (Misc queries) 16 April 4th 05 05:49 AM
counting cells with conditional formatting applied HalB Excel Discussion (Misc queries) 3 February 21st 05 01:21 PM


All times are GMT +1. The time now is 02:27 AM.

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

About Us

"It's about Microsoft Excel"