locked cells and code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

If cells are 'locked' I have found that data which is supposed to be
inserted by code isn't.
Is there a way around this?
 
The code needs to unprotect the worksheet before updating the cells and, if
required, protect the worksheet after updating the cells.
 
Jock,

Unprotect make you changes and then reprotect at runtime

Sub standard()
ActiveSheet.Unprotect Password:="Mypass"
'Make your changes
ActiveSheet.protect Password:="Mypass"
End Sub

Mike
 
Thanks to Trevor & Mike
--
Traa Dy Liooar

Jock


Trevor via OfficeKB.com said:
The code needs to unprotect the worksheet before updating the cells and, if
required, protect the worksheet after updating the cells.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top