check if worksheet is protected using code

  • Thread starter Thread starter neowok
  • Start date Start date
N

neowok

Just wondering if theres a way i can do a simple "i
Worksheets("3.Data") is protected then"

also how would i assign a value to a cell using code? i.e. say A1
"blah" ? it didnt like cells(a1)="blah" which i assumed would be th
way.

thank
 
Hi
For your first question try
If Worksheets("3.Data").ProtectContents = True Then
MsgBox "The contents of shet '3-data 'are
protected."
End If


Second question
use something like
Range("A1").value="text"
or
cells(1,1).value="text"
 

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