Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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
Posted to microsoft.public.excel.misc
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Allow user to run a macro in protected mode | Excel Discussion (Misc queries) | |||
Spell Check in Protected Worksheet & Shared Workbook | Excel Discussion (Misc queries) | |||
How to see macro code of a password protected macro without a password? | Excel Worksheet Functions | |||
Closing File Error | Excel Discussion (Misc queries) | |||
Macro Suddenly Fails | Excel Discussion (Misc queries) |