Is active cell editable?

  • Thread starter Thread starter XP
  • Start date Start date
X

XP

Using Office 2007 with Win XP;

I need to determine if the active cell is currently in an editable state. I
guess that really translates into whether or not it is locked AND sheet
protection is turned on? Is this all that needs to be tested?

Does anyone have efficient example code that might return true if
editable/false if not? If so, could you please post?

Thanks much in advance.
 
Hi,

Try this. the message boxes are just for demonstration

Sub sonic()
If ActiveSheet.ProtectContents And ActiveCell.Locked Then
MsgBox "Locked"
Else
MsgBox "Unlocked"
End If

End Sub
Mike
 

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