ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Preventing Movement in Protected Areas in Microsoft Excel (https://www.excelbanter.com/excel-discussion-misc-queries/55000-preventing-movement-protected-areas-microsoft-excel.html)

andremations

Preventing Movement in Protected Areas in Microsoft Excel
 

Hi All,

Is there a way to save the EnableSelection property of a sheet? Because
whenever I open a saved sheet after I have changed the EnableSelection
property from 0-x|NoRestrictions to 1-x|UnlockedCells the property
always changes back 0-x|NoRestrictions. Thanks in advance.

Andre


--
andremations
------------------------------------------------------------------------
andremations's Profile: http://www.excelforum.com/member.php...o&userid=28688
View this thread: http://www.excelforum.com/showthread...hreadid=484307


Dave Peterson

Preventing Movement in Protected Areas in Microsoft Excel
 
You could set it each time the workbook opens (with macros enabled):

Option Explicit
Sub auto_open()
Dim wks As Worksheet
Set wks = Worksheets("sheet1")
With wks
.Select
.Protect
.EnableSelection = xlUnlockedCells
End With
End Sub



andremations wrote:

Hi All,

Is there a way to save the EnableSelection property of a sheet? Because
whenever I open a saved sheet after I have changed the EnableSelection
property from 0-x|NoRestrictions to 1-x|UnlockedCells the property
always changes back 0-x|NoRestrictions. Thanks in advance.

Andre

--
andremations
------------------------------------------------------------------------
andremations's Profile: http://www.excelforum.com/member.php...o&userid=28688
View this thread: http://www.excelforum.com/showthread...hreadid=484307


--

Dave Peterson

andremations

Preventing Movement in Protected Areas in Microsoft Excel
 

Thanks for the quick reply Dave!

I have already placed the "script" that you told me in VBA. Got one
more question here... (I am really new to most advanced features of
Excel). Can you please tell me how to Enable the Macros?


--
andremations
------------------------------------------------------------------------
andremations's Profile: http://www.excelforum.com/member.php...o&userid=28688
View this thread: http://www.excelforum.com/showthread...hreadid=484307


Dave Peterson

Preventing Movement in Protected Areas in Microsoft Excel
 
Two steps.

Depending on your version, the options could be different--but in xl2002+
Tools|macro|security|security level
change your setting to medium to be prompted each time you open a workbook with
macros or change it to low to never be prompted. (Low isn't recommended by MS.)

Then close your workbook and reopen it.
Answer yes to allow macros (if you get prompted).

Note that this is a user setting. If you share the workbook with others,
they'll have to make the same kind of decisions. You won't be able to change
this setting (via your code) if they don't enable macros.

andremations wrote:

Thanks for the quick reply Dave!

I have already placed the "script" that you told me in VBA. Got one
more question here... (I am really new to most advanced features of
Excel). Can you please tell me how to Enable the Macros?

--
andremations
------------------------------------------------------------------------
andremations's Profile: http://www.excelforum.com/member.php...o&userid=28688
View this thread: http://www.excelforum.com/showthread...hreadid=484307


--

Dave Peterson

andremations

Preventing Movement in Protected Areas in Microsoft Excel
 

Thank you so much!


--
andremations
------------------------------------------------------------------------
andremations's Profile: http://www.excelforum.com/member.php...o&userid=28688
View this thread: http://www.excelforum.com/showthread...hreadid=484307



All times are GMT +1. The time now is 08:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com