Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
George Tattam
 
Posts: n/a
Default Macro fails when worksheet protected

I have a worksheet with a very simple macro which sorts a range of data on
the last column in the range.The macro runs fine when the worksheet is
unprotected but fails when protected. The error message is "Sort method of
range class failed". I have made sure all the cells in the range are
unlocked.I am running on Windows 2000.Any Ideas?


  #2   Report Post  
Posted to microsoft.public.excel.misc
Ron de Bruin
 
Posts: n/a
Default Macro fails when worksheet protected

Hi George

If you use 2002 or 2003 then when you protect your sheet you check "Sort"
in the list. (ToolsProtection.....Protect sheet)

--
Regards Ron de Bruin
http://www.rondebruin.nl


"George Tattam" wrote in message ...
I have a worksheet with a very simple macro which sorts a range of data on the last column in the range.The macro runs fine when
the worksheet is unprotected but fails when protected. The error message is "Sort method of range class failed". I have made sure
all the cells in the range are unlocked.I am running on Windows 2000.Any Ideas?



  #3   Report Post  
Posted to microsoft.public.excel.misc
George Tattam
 
Posts: n/a
Default Macro fails when worksheet protected

Thanks Ron,

I have 2002 at home, but 2000 at work. If I make the changes in 2002, do you
know if they will take in 2000?

George

"Ron de Bruin" wrote in message
...
Hi George

If you use 2002 or 2003 then when you protect your sheet you check "Sort"
in the list. (ToolsProtection.....Protect sheet)

--
Regards Ron de Bruin
http://www.rondebruin.nl


"George Tattam" wrote in message
...
I have a worksheet with a very simple macro which sorts a range of data on
the last column in the range.The macro runs fine when the worksheet is
unprotected but fails when protected. The error message is "Sort method of
range class failed". I have made sure all the cells in the range are
unlocked.I am running on Windows 2000.Any Ideas?





  #4   Report Post  
Posted to microsoft.public.excel.misc
Ron de Bruin
 
Posts: n/a
Default Macro fails when worksheet protected

No this will not work in 2000
Can't you use code to Sort ??



--
Regards Ron de Bruin
http://www.rondebruin.nl


"George Tattam" wrote in message ...
Thanks Ron,

I have 2002 at home, but 2000 at work. If I make the changes in 2002, do you know if they will take in 2000?

George

"Ron de Bruin" wrote in message ...
Hi George

If you use 2002 or 2003 then when you protect your sheet you check "Sort"
in the list. (ToolsProtection.....Protect sheet)

--
Regards Ron de Bruin
http://www.rondebruin.nl


"George Tattam" wrote in message ...
I have a worksheet with a very simple macro which sorts a range of data on the last column in the range.The macro runs fine when
the worksheet is unprotected but fails when protected. The error message is "Sort method of range class failed". I have made sure
all the cells in the range are unlocked.I am running on Windows 2000.Any Ideas?







  #5   Report Post  
Posted to microsoft.public.excel.misc
Dave Peterson
 
Posts: n/a
Default Macro fails when worksheet protected

Nope.

But you could change your macro to unprotect the worksheet, do the sort,
reprotect the worksheet.

worksheets("Sheet1").unprotect password:="hithere"
'do the sort
worksheets("sheet1").protect password:="hithere"



George Tattam wrote:

Thanks Ron,

I have 2002 at home, but 2000 at work. If I make the changes in 2002, do you
know if they will take in 2000?

George

"Ron de Bruin" wrote in message
...
Hi George

If you use 2002 or 2003 then when you protect your sheet you check "Sort"
in the list. (ToolsProtection.....Protect sheet)

--
Regards Ron de Bruin
http://www.rondebruin.nl


"George Tattam" wrote in message
...
I have a worksheet with a very simple macro which sorts a range of data on
the last column in the range.The macro runs fine when the worksheet is
unprotected but fails when protected. The error message is "Sort method of
range class failed". I have made sure all the cells in the range are
unlocked.I am running on Windows 2000.Any Ideas?




--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
George Tattam
 
Posts: n/a
Default Macro fails when worksheet protected

Great idea.

Thanks Dave.
"Dave Peterson" wrote in message
...
Nope.

But you could change your macro to unprotect the worksheet, do the sort,
reprotect the worksheet.

worksheets("Sheet1").unprotect password:="hithere"
'do the sort
worksheets("sheet1").protect password:="hithere"



George Tattam wrote:

Thanks Ron,

I have 2002 at home, but 2000 at work. If I make the changes in 2002, do
you
know if they will take in 2000?

George

"Ron de Bruin" wrote in message
...
Hi George

If you use 2002 or 2003 then when you protect your sheet you check
"Sort"
in the list. (ToolsProtection.....Protect sheet)

--
Regards Ron de Bruin
http://www.rondebruin.nl


"George Tattam" wrote in message
...
I have a worksheet with a very simple macro which sorts a range of data
on
the last column in the range.The macro runs fine when the worksheet is
unprotected but fails when protected. The error message is "Sort method
of
range class failed". I have made sure all the cells in the range are
unlocked.I am running on Windows 2000.Any Ideas?




--

Dave Peterson



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
Allow user to run a macro in protected mode Jean Cloutier Excel Discussion (Misc queries) 2 November 23rd 05 08:55 PM
Spell Check in Protected Worksheet & Shared Workbook DaveyC4S Excel Discussion (Misc queries) 6 October 28th 05 12:50 PM
How to see macro code of a password protected macro without a password? Dmitry Kopnichev Excel Worksheet Functions 5 October 27th 05 09:57 AM
Closing File Error jcliquidtension Excel Discussion (Misc queries) 4 October 20th 05 12:22 PM
Macro Suddenly Fails Bill Martin Excel Discussion (Misc queries) 2 September 16th 05 01:55 PM


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