Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 129
Default How can I sort when the worksheet is locked?

Hi everyone,

Is there a way to enable the sorting feature in Excel when the worksheet is
locked?

Thanks,
GU
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default How can I sort when the worksheet is locked?

Locked means protected, right. Most of the controls are disable when this
feature is utilized. If you don't have the password, the best you can hope
for is to copy/paste to a new sheet and work from there.

Regards,
Ryan--

--
RyGuy


"Neon520" wrote:

Hi everyone,

Is there a way to enable the sorting feature in Excel when the worksheet is
locked?

Thanks,
GU

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 129
Default How can I sort when the worksheet is locked?

Yes, by locked I mean protected.
My goal is to create a template that consist of formula and I need to
protected the sheet to prevent lost of formula and I need to have the sorting
feature available once the data has been input to the template.


"ryguy7272" wrote:

Locked means protected, right. Most of the controls are disable when this
feature is utilized. If you don't have the password, the best you can hope
for is to copy/paste to a new sheet and work from there.

Regards,
Ryan--

--
RyGuy


"Neon520" wrote:

Hi everyone,

Is there a way to enable the sorting feature in Excel when the worksheet is
locked?

Thanks,
GU

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default How can I sort when the worksheet is locked?

Most common method is to use code to unprotect, do the sort, then reprotect.

Assuming version of Excel is later than 2000. If 2000 or earlier read the
quoted bit below from Jerry Latham and use the second set of code.

Sub sortit()
Dim coltosort As Range
Set coltosort = ActiveSheet.Range("A6:A60")
ActiveSheet.Unprotect Password:="justme"
coltosort.Select
Selection.Sort Key1:=coltosort.Cells(2), _
Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
With ActiveSheet
.Protect Password:="justme"
.EnableSelection = xlNoRestrictions
End With
End Sub

Ok, that explains it - you're probably running Excel 2000? The "Data
Option1" (there's also a 2 and 3) didn't exist in 2000. The macro was
probably created on machine with Excel 2003 on it. Easy to fix, just delete
everything in that line from the comma just ahead of DataOption1 to the end
of the line. Code should end up looking like:

Sub sortit()
Dim coltosort As Range
Set coltosort = ActiveSheet.Range("A6:A60")
ActiveSheet.Unprotect Password:="justme"
coltosort.Select
Selection.Sort Key1:=coltosort.Cells(2), _
Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, _
Orientation:=xlTopToBottom
With ActiveSheet
.Protect Password:="justme"
.EnableSelection = xlNoRestrictions
End With
End Sub


Gord Dibben MS Excel MVP

On Wed, 9 Jan 2008 13:46:11 -0800, Neon520
wrote:

Yes, by locked I mean protected.
My goal is to create a template that consist of formula and I need to
protected the sheet to prevent lost of formula and I need to have the sorting
feature available once the data has been input to the template.


"ryguy7272" wrote:

Locked means protected, right. Most of the controls are disable when this
feature is utilized. If you don't have the password, the best you can hope
for is to copy/paste to a new sheet and work from there.

Regards,
Ryan--

--
RyGuy


"Neon520" wrote:

Hi everyone,

Is there a way to enable the sorting feature in Excel when the worksheet is
locked?

Thanks,
GU


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
Locked Worksheet EC Excel Discussion (Misc queries) 1 September 5th 07 04:10 AM
Locked worksheet Kevin Gallagher Excel Discussion (Misc queries) 0 August 30th 07 07:30 PM
How do I sort locked cells in Excel? Cathy Excel Worksheet Functions 4 August 9th 06 04:51 PM
Worksheet locked for editing Mac1 New Users to Excel 2 February 23rd 06 02:16 PM
Worksheet Locked Hector R. Barrera Excel Worksheet Functions 0 December 28th 05 11:28 PM


All times are GMT +1. The time now is 11:45 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"