View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Changing the value of a protected cell

Wow!

You live in interesting times.

(not meant as a Chinese curse!)

NickHK wrote:

Dave,
Thanks.
I'm currently on a Chinese system without Office installed, so it was
guesswork.

NickHK

"Dave Peterson"
...
UserInterfaceOnly = UIOnly

(just a clarification)

NickHK wrote:

Shawn,
Look at the arguments for the Protect method.
You have an option of UIOnly (or something like that). That means that
the
user cannot change the sheet, but code can.

NickHK

"Shawn"
...

Sub go()
Dim goal As Range
Set goal = Sheets("sheet1").Range("A1")

Range("A1") = goal + 1
End Sub

I get an error because this is on a protected sheet and protected cell.
How
can I get result without having to unprotect the sheet?


--
Thanks
Shawn


--

Dave Peterson


--

Dave Peterson