View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Selecting cells by colour

Sub sufgreen()
Set rr = Nothing
For Each r In ActiveSheet.UsedRange
If r.Interior.ColorIndex = 10 Then
If rr Is Nothing Then
Set rr = r
Else
Set rr = Union(rr, r)
End If
End If
Next
If Not rr Is Nothing Then
rr.Select
End If
End Sub
--
Gary''s Student - gsnu200733