Protect cell - VBA
Hi,
I want to protect cells of a particular color usning this code
Sub Protectme()
For i = FirstRow To RowCount 'row
For j = FirstCol To Colcount ' col
If CellColorIndex(Cells(i, j)) = 24 Then
Range.Cells(i,j).Locked = True --- Some problem in this line
End If
Next j
Next i
ActiveSheet.Protect
End Sub
This gives me a run time error.. Can somebody help me ??
Thanks,
Avinash
|