Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 24
Default Macro for protecting sheet

I have recorded a macro that protects a sheet. The coding that I have is

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

When I protect the sheet I want it so that only Unlocked cells can be
selected. My coding above does not do this.

What do I need to do to my code to make it so that a user cannot select
Unlocked cells, and only allow the user to select only Unlocked cells.

Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Macro for protecting sheet

look for enableselection in VBA's help.

You'll see a nice example.

JoeP wrote:

I have recorded a macro that protects a sheet. The coding that I have is

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

When I protect the sheet I want it so that only Unlocked cells can be
selected. My coding above does not do this.

What do I need to do to my code to make it so that a user cannot select
Unlocked cells, and only allow the user to select only Unlocked cells.

Thanks.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Macro for protecting sheet

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
ActiveSheet.EnableSelection = xlUnlockedCells


Gord Dibben MS Excel MVP

On Mon, 26 Nov 2007 15:06:01 -0800, JoeP wrote:

I have recorded a macro that protects a sheet. The coding that I have is

ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True

When I protect the sheet I want it so that only Unlocked cells can be
selected. My coding above does not do this.

What do I need to do to my code to make it so that a user cannot select
Unlocked cells, and only allow the user to select only Unlocked cells.

Thanks.


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
Protecting sheet that has macro ub Excel Worksheet Functions 5 October 6th 07 12:37 AM
Can't use tab after protecting sheet. tonyia Excel Worksheet Functions 0 March 21st 06 03:57 PM
Protecting Sheet purplerayn Excel Worksheet Functions 1 October 21st 05 12:55 AM
macro for Protecting a Sheet cincode5 Excel Discussion (Misc queries) 5 July 20th 05 11:59 AM
Can't use tab after protecting sheet. snam Excel Discussion (Misc queries) 3 January 21st 05 02:54 PM


All times are GMT +1. The time now is 10:27 AM.

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"