View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Range based on interior color index?

Hi Garle,

I think that you eould need to loop through the cells and bulid the required
range, e.g.:

'=============
Public Sub Tester3()
Dim Rng As Range
Dim Rng2 As Range
Dim rCell As Range

Set Rng = Range("A1:K100")

For Each rCell In Rng.Cells
If rCell.Interior.ColorIndex = 38 Then
If Rng2 Is Nothing Then
Set Rng2 = rCell
Else
Set Rng2 = Union(rCell, Rng2)
End If
End If
Next rCell

Rng2.Select

End Sub
'<<=============

---
Regards,
Norman


"garle" wrote in message
ups.com...
Is there a way for me to define a range based on a particular interior
color index value? For example, can I "select" a group of cells on a
sheet that have a color index of 38?

Thanks in advance for any help!