Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Elaine,
Try this: Private Sub CommandButton2_Click() Dim CompleteRows As Range Const INDEX_RED As Long = 3 Set CompleteRows = GetCompleteColouredRows(Range("C6:G8"), INDEX_RED) If Not CompleteRows Is Nothing Then MsgBox CompleteRows.Address Else MsgBox "No complete rows coloured" End If End Sub Private Function GetCompleteColouredRows(CheckRange As Range, ColourIndexToMatch As Long) As Range Dim i As Long Dim MatchedRange As Range With CheckRange For i = 1 To .Rows.Count If .Rows(i).Interior.ColorIndex = ColourIndexToMatch Then If MatchedRange Is Nothing Then Set MatchedRange = .Cells(i, 1) Else Set MatchedRange = Union(MatchedRange, .Cells(i, 1)) End If End If Next End With Set GetCompleteColouredRows = MatchedRange End Function NickHK "elaine" wrote in message oups.com... Hi, Does anyone know whether there is a way to identify within a range of F1:CU:5000, which columns is coloured consecutively? (ie. I want to see which row is coloured in Red from F to CU Throughout.) Thanks. Elaine. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Countif non consecutive columns | New Users to Excel | |||
Count non consecutive columns | Excel Worksheet Functions | |||
In Excel, print non-consecutive columns. | Excel Discussion (Misc queries) | |||
adding three consecutive columns | Excel Worksheet Functions | |||
how do i add consecutive columns in excel ? | Excel Discussion (Misc queries) |