View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
TxRaistlin TxRaistlin is offline
external usenet poster
 
Posts: 22
Default lock all cells of a certain color

Haven't found this yet in previous threads, but I'm sure i missed it.

I am trying to Lock all cells that are a certain color as follows:

Sub lock_all_tan()

For Each s In Sheets
For Each c In Cells
If c.ColorIndex = 40 Then
c.Locked = False
c.FormulaHidden = False
End If
Next
Next

End Sub

The above doesn't work at all, appreciate any help. Thanks, Jason