LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 47
Default Select a range based on Fill Color

I need to select a range starting from the cell above the activecell and
continuing upward and stopping when it finds the first cell that contains a
fill color. In other words, I need to select the first group of cells above
the active cell that all have "no fill" as their fill color.

I then want to take that range and plug it into the =COUNTA() formula for
the activecell. But first I just want to find the range, I'll worry about
the formula later.

Here's what I've written so far which doesn't seem to be working:

Private Sub CommandButton1_Click()

Dim StartCell As Range

Set StartCell = ActiveCell

Do While ActiveCell.Interior.ColorIndex = xlColorIndexNone
Range(StartCell & ":" & ActiveCell.Offset(-1, 0)).Select
Loop

End Sub

Anybody have an idea on how to do this?


 
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
How can I select pivot table row totals to fill color them Ruth5155 Charts and Charting in Excel 2 April 19th 10 06:52 AM
Fill color based on RGB ADK Excel Programming 12 March 6th 08 09:44 AM
Is there a way to count cells in a range based on fill color? eehinmd Excel Worksheet Functions 2 March 16th 06 05:09 PM
change fill color of a range of cells based on color of a cell? DarMelNel Excel Programming 0 March 2nd 06 06:35 PM
Select or Filter by Fill Color Wil Excel Worksheet Functions 1 November 4th 04 10:03 PM


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

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"