Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Count no of rows with interior color

Hello!


Is it possible to count the nuber of rows in a range with interior
color (any)

for eg. on range "B1:F20" if any cell in B1:F1 got interior color count
it and check next row B2:F2 ... like wise and count the number of rows
in the range having atleast one cell with interior color.

thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Count no of rows with interior color

here's one way. it will count the number filled with blue (37) in column a

Option Explicit
Dim cell As Range
Dim lastrow As Long
Dim wks1 As Worksheet
Dim i As Integer
Sub count_colors()
lastrow = Worksheets("sheet1").Cells(Rows.Count, "A").End(xlUp).Row
Set wks1 = Worksheets("Sheet1")

Dim counter As Integer
For i = lastrow To 1 Step -1
Debug.Print lastrow
If Cells(i, 1).Interior.ColorIndex = 37 Then
counter = counter + 1
End If
Next i
MsgBox counter
Debug.Print i
End Sub

--


Gary


"sheeba" wrote in message
oups.com...
Hello!


Is it possible to count the nuber of rows in a range with interior
color (any)

for eg. on range "B1:F20" if any cell in B1:F1 got interior color count
it and check next row B2:F2 ... like wise and count the number of rows
in the range having atleast one cell with interior color.

thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Count no of rows with interior color

Hi Sheeba,

See Chip Pearsons colour functions page at:

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


---
Regards,
Norman


"sheeba" wrote in message
oups.com...
Hello!


Is it possible to count the nuber of rows in a range with interior
color (any)

for eg. on range "B1:F20" if any cell in B1:F1 got interior color count
it and check next row B2:F2 ... like wise and count the number of rows
in the range having atleast one cell with interior color.

thanks



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Count no of rows with interior color

or http://www.xldynamic.com/source/xld.ColourCounter.html

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Norman Jones" wrote in message
...
Hi Sheeba,

See Chip Pearsons colour functions page at:

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


---
Regards,
Norman


"sheeba" wrote in message
oups.com...
Hello!


Is it possible to count the nuber of rows in a range with interior
color (any)

for eg. on range "B1:F20" if any cell in B1:F1 got interior color count
it and check next row B2:F2 ... like wise and count the number of rows
in the range having atleast one cell with interior color.

thanks





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
interior color of a cell R.VENKATARAMAN Excel Programming 9 November 11th 05 04:15 AM
color the interior of a range Pierre via OfficeKB.com Excel Worksheet Functions 1 November 2nd 05 12:55 PM
Print without Interior Color bhofsetz Excel Discussion (Misc queries) 2 July 19th 05 04:28 PM
Passing Back Color to Interior Color ExcelMonkey[_190_] Excel Programming 1 March 22nd 05 04:27 PM
Interior Cell color Pellechi Excel Programming 1 September 23rd 03 03:39 PM


All times are GMT +1. The time now is 05:29 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"