LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,073
Default Limiting a worksheet's selection range.

xl2003, Windows XP:

Sub SaveSelectUnlocked()
Dim SaveAsFilename
ActiveSheet.Unprotect
With Range("A1,B2,C3")
.Locked = False
.FormulaHidden = False
End With
With ActiveSheet
.EnableSelection = xlUnlockedCells
.Protect
End With
ActiveWorkbook.Protect
SaveAsFilename = Application.GetSaveAsFilename(InitialFileName:="")
If SaveAsFilename < False Then ActiveWorkbook.SaveAs (SaveAsFilename)
End Sub

I was hoping the above code would result in a SavedAs copy of the
workbook with the only selectable cells being A1, B2 and C3. As soon
as the code has finished running that is the case. However, after
closing and reopening the workbook, all cells are selectable. Even
manually saving the workbook resulting from the code, closing and
reopening results in all cells being selectable.

Is there a way of programatically limiting a worksheet's selection
range to unlocked cells so that it is retained between sessions?

Ken Johnson

 
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
Pivot Table limiting user selection PJS Excel Discussion (Misc queries) 2 April 29th 10 06:33 PM
Limiting selection in a cell AND linking that selection to a list Lisa Excel Discussion (Misc queries) 1 July 28th 09 05:00 PM
Limiting the range of AutoFilter? CDiddy Excel Worksheet Functions 5 July 8th 06 08:20 PM
Limiting the range of a lookup function Dorn Excel Worksheet Functions 5 November 8th 05 01:59 AM
Excel VBA - Range(Selection, Selection.End(xlDown)).Name issue. jonH Excel Programming 3 June 7th 04 09:13 PM


All times are GMT +1. The time now is 11:22 AM.

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

About Us

"It's about Microsoft Excel"