close

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 quot;Sort method of
range class failedquot;. I have made sure all the cells in the range are
unlocked.I am running on Windows 2000.Any Ideas?
Hi George

If you use 2002 or 2003 then when you protect your sheet you check quot;Sortquot;
in the list. (Toolsgt;Protection.....Protect sheet)

--
Regards Ron de Bruin
www.rondebruin.nlquot;George Tattamquot; gt; wrote in message ...
gt;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
gt;the worksheet is unprotected but fails when protected. The error message is quot;Sort method of range class failedquot;. I have made sure
gt;all the cells in the range are unlocked.I am running on Windows 2000.Any Ideas?
gt;
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

quot;Ron de Bruinquot; gt; wrote in message
...
gt; Hi George
gt;
gt; If you use 2002 or 2003 then when you protect your sheet you check quot;Sortquot;
gt; in the list. (Toolsgt;Protection.....Protect sheet)
gt;
gt; --
gt; Regards Ron de Bruin
gt; www.rondebruin.nl
gt;
gt;
gt; quot;George Tattamquot; gt; wrote in message
gt; ...
gt;gt;I have a worksheet with a very simple macro which sorts a range of data on
gt;gt;the last column in the range.The macro runs fine when the worksheet is
gt;gt;unprotected but fails when protected. The error message is quot;Sort method of
gt;gt;range class failedquot;. I have made sure all the cells in the range are
gt;gt;unlocked.I am running on Windows 2000.Any Ideas?
gt;gt;
gt;
gt;
No this will not work in 2000
Can't you use code to Sort ??
--
Regards Ron de Bruin
www.rondebruin.nlquot;George Tattamquot; gt; wrote in message ...
gt; Thanks Ron,
gt;
gt; 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?
gt;
gt; George
gt;
gt; quot;Ron de Bruinquot; gt; wrote in message ...
gt;gt; Hi George
gt;gt;
gt;gt; If you use 2002 or 2003 then when you protect your sheet you check quot;Sortquot;
gt;gt; in the list. (Toolsgt;Protection.....Protect sheet)
gt;gt;
gt;gt; --
gt;gt; Regards Ron de Bruin
gt;gt; www.rondebruin.nl
gt;gt;
gt;gt;
gt;gt; quot;George Tattamquot; gt; wrote in message ...
gt;gt;gt;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
gt;gt;gt;the worksheet is unprotected but fails when protected. The error message is quot;Sort method of range class failedquot;. I have made sure
gt;gt;gt;all the cells in the range are unlocked.I am running on Windows 2000.Any Ideas?
gt;gt;gt;
gt;gt;
gt;gt;
gt;
gt;
Nope.

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

worksheets(quot;Sheet1quot;).unprotect password:=quot;hitherequot;
'do the sort
worksheets(quot;sheet1quot;).protect password:=quot;hitherequot;
George Tattam wrote:
gt;
gt; Thanks Ron,
gt;
gt; I have 2002 at home, but 2000 at work. If I make the changes in 2002, do you
gt; know if they will take in 2000?
gt;
gt; George
gt;
gt; quot;Ron de Bruinquot; gt; wrote in message
gt; ...
gt; gt; Hi George
gt; gt;
gt; gt; If you use 2002 or 2003 then when you protect your sheet you check quot;Sortquot;
gt; gt; in the list. (Toolsgt;Protection.....Protect sheet)
gt; gt;
gt; gt; --
gt; gt; Regards Ron de Bruin
gt; gt; www.rondebruin.nl
gt; gt;
gt; gt;
gt; gt; quot;George Tattamquot; gt; wrote in message
gt; gt; ...
gt; gt;gt;I have a worksheet with a very simple macro which sorts a range of data on
gt; gt;gt;the last column in the range.The macro runs fine when the worksheet is
gt; gt;gt;unprotected but fails when protected. The error message is quot;Sort method of
gt; gt;gt;range class failedquot;. I have made sure all the cells in the range are
gt; gt;gt;unlocked.I am running on Windows 2000.Any Ideas?
gt; gt;gt;
gt; gt;
gt; gt;

--

Dave Peterson

Great idea.

Thanks Dave.
quot;Dave Petersonquot; gt; wrote in message
...
gt; Nope.
gt;
gt; But you could change your macro to unprotect the worksheet, do the sort,
gt; reprotect the worksheet.
gt;
gt; worksheets(quot;Sheet1quot;).unprotect password:=quot;hitherequot;
gt; 'do the sort
gt; worksheets(quot;sheet1quot;).protect password:=quot;hitherequot;
gt;
gt;
gt;
gt; George Tattam wrote:
gt;gt;
gt;gt; Thanks Ron,
gt;gt;
gt;gt; I have 2002 at home, but 2000 at work. If I make the changes in 2002, do
gt;gt; you
gt;gt; know if they will take in 2000?
gt;gt;
gt;gt; George
gt;gt;
gt;gt; quot;Ron de Bruinquot; gt; wrote in message
gt;gt; ...
gt;gt; gt; Hi George
gt;gt; gt;
gt;gt; gt; If you use 2002 or 2003 then when you protect your sheet you check
gt;gt; gt; quot;Sortquot;
gt;gt; gt; in the list. (Toolsgt;Protection.....Protect sheet)
gt;gt; gt;
gt;gt; gt; --
gt;gt; gt; Regards Ron de Bruin
gt;gt; gt; www.rondebruin.nl
gt;gt; gt;
gt;gt; gt;
gt;gt; gt; quot;George Tattamquot; gt; wrote in message
gt;gt; gt; ...
gt;gt; gt;gt;I have a worksheet with a very simple macro which sorts a range of data
gt;gt; gt;gt;on
gt;gt; gt;gt;the last column in the range.The macro runs fine when the worksheet is
gt;gt; gt;gt;unprotected but fails when protected. The error message is quot;Sort method
gt;gt; gt;gt;of
gt;gt; gt;gt;range class failedquot;. I have made sure all the cells in the range are
gt;gt; gt;gt;unlocked.I am running on Windows 2000.Any Ideas?
gt;gt; gt;gt;
gt;gt; gt;
gt;gt; gt;
gt;
gt; --
gt;
gt; Dave Peterson

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()