Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Protect cell - VBA
Try
Cells(i,j).Locked = True Regards Trevor "Avi" wrote in message oups.com... 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Protect or Unprotect Cell dependent on different cell | Excel Discussion (Misc queries) | |||
Is it possible to protect cell formatting in an unlocked cell? | Excel Discussion (Misc queries) | |||
EXCEL: Protect a cell depending on another cell value | Excel Worksheet Functions | |||
Protect Cell | Excel Worksheet Functions | |||
protect specific cell but allow edit on other cell | Excel Worksheet Functions |