Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
XP XP is offline
external usenet poster
 
Posts: 389
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Row select mode to highlight active row of active cell Bart Fay[_2_] Excel Discussion (Misc queries) 0 May 11th 10 09:34 PM
editable cell in a dropdown list Nelson Noel Excel Worksheet Functions 1 February 21st 09 05:46 PM
How to make cell not editable [email protected] Excel Worksheet Functions 1 August 6th 07 09:11 AM
Cell is locked but still editable... [email protected] Excel Programming 2 March 30th 06 02:00 PM
Protect a Cell in an Editable Range Gary Excel Programming 1 February 18th 04 07:09 AM


All times are GMT +1. The time now is 07:11 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"