View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Chris Gorham Chris Gorham is offline
external usenet poster
 
Posts: 32
Default Searching for Boolean Cells

Hi,

I'm using the following statement to set an object equal to the boolean
cells in a worksheet. After that I can colour them to identify their
location. However if there are no such cells in the worksheet an error is
generated. I could use resume next and clear the errors but a neater way
would obviously be a test for the existence of boolean cells before the
colouring loop is entered

dim cellcollection as object
Set cellCollection = Selection.SpecialCells(xlCellTypeConstants, xlLogical)
For Each cell In cellCollection
ActiveSheet.Cells(cell.Row, cell.Column).Interior.ColorIndex =
booleanColour
Next cell

Suggestions...Thanks Chris