Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Is active cell editable?
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Is active cell editable?
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 "XP" wrote: 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. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Is active cell editable?
This should do what you need, just replace the message box with whatever you want to happen! Sub check_locked_cell() With ActiveSheet If ActiveSheet.ProtectContents = True And Selection.Locked = True Then MsgBox "Activesheet is protected & Activecell is locked" End If End With End Sub -- The Code Cage Team Regards, The Code Cage Team www.thecodecage.com ------------------------------------------------------------------------ The Code Cage Team's Profile: http://www.thecodecage.com/forumz/member.php?userid=2 View this thread: http://www.thecodecage.com/forumz/showthread.php?t=8606 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Row select mode to highlight active row of active cell | Excel Discussion (Misc queries) | |||
editable cell in a dropdown list | Excel Worksheet Functions | |||
How to make cell not editable | Excel Worksheet Functions | |||
Cell is locked but still editable... | Excel Programming | |||
Protect a Cell in an Editable Range | Excel Programming |