can anybody please help me. how will i modify unlocked a particular cell using macro and locked it again. thanks in advance!!
Printable View
can anybody please help me. how will i modify unlocked a particular cell using macro and locked it again. thanks in advance!!
lets say you want to change the value of cell F20 in sheet 1 and your sheet is protected with the password "jug" ('locked' property doesn't hold good if the sheet is not protected)
try the following macro
VB Code:
Sub Macro1() Sheets("sheet1").Select ActiveSheet.Unprotect ("jug") ' unprotect sheet using "jug" as password Range("f20").Select Range("f20").Value = 10 ' change value of cell ActiveSheet.Protect ("jug") ' protect sheet using "jug" as password End Sub
hope this helps...
ok..thanks a bunch!!!