ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Dealing with a Locked Cell (https://www.excelbanter.com/excel-programming/339361-dealing-locked-cell.html)

Craig[_21_]

Dealing with a Locked Cell
 
Hi there, I'm having trouble with unprotecting a worksheet then changing a
cells value to locked or unlocked?

I'm using this:

sheet1.unprotect
sheet1.Range("A1").locked=False
if(sheet2.Range("B200").value = "Apples" then
sheet1.Range("A1").value=""
sheet1.Range("A1").locked=True
end if
sheet1.protect
this is just an example... but seems to error with the .locked=true or false
Any Ideas?

Thanks in advance

Craig




Craig[_21_]

Dealing with a Locked Cell
 
Hey... Sorry for wasting space, I solved my problem. Appearently I was
dealing with merged cells.
I needed to specify range("A1:A3").locked =?
till we me again!
Craig

"Craig" wrote in message
news:oPwTe.418967$5V4.404463@pd7tw3no...
Hi there, I'm having trouble with unprotecting a worksheet then changing
a cells value to locked or unlocked?

I'm using this:

sheet1.unprotect
sheet1.Range("A1").locked=False
if(sheet2.Range("B200").value = "Apples" then
sheet1.Range("A1").value=""
sheet1.Range("A1").locked=True
end if
sheet1.protect
this is just an example... but seems to error with the .locked=true or
false
Any Ideas?

Thanks in advance

Craig






Dave Peterson

Dealing with a Locked Cell
 
Or...

Sheet1.Range("A1").MergeArea.Locked = True



Craig wrote:

Hey... Sorry for wasting space, I solved my problem. Appearently I was
dealing with merged cells.
I needed to specify range("A1:A3").locked =?
till we me again!
Craig

"Craig" wrote in message
news:oPwTe.418967$5V4.404463@pd7tw3no...
Hi there, I'm having trouble with unprotecting a worksheet then changing
a cells value to locked or unlocked?

I'm using this:

sheet1.unprotect
sheet1.Range("A1").locked=False
if(sheet2.Range("B200").value = "Apples" then
sheet1.Range("A1").value=""
sheet1.Range("A1").locked=True
end if
sheet1.protect
this is just an example... but seems to error with the .locked=true or
false
Any Ideas?

Thanks in advance

?
? Craig
?
?
?


--

Dave Peterson


All times are GMT +1. The time now is 08:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com