LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 54
Default Run-time error 1004...

I have a workbook with a macro that sorts rows alphabetically. I've now
shared the workbook and now my macro doesn't work. Here's the macro followed
by the error I'm getting:

Sub ALPHA()
ActiveSheet.Unprotect
Range("B3:H999").Sort Key1:=Range("B2"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub

Run-time error €˜1004: Unprotected method of Worksheet failed

I tried to ignore lines 2 and 6 thinking that the protection codes were the
problem. Now I get the following error:

Sub ALPHA()
' ActiveSheet.Unprotect
Range("B3:H999").Sort Key1:=Range("B2"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
' ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub

I get the following error:
Run-time error €˜1004: Sort method of Range class failed

Please help me fix this. Thank you.
 
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
Run-time error '1004' goconnor Excel Discussion (Misc queries) 8 July 18th 08 12:50 AM
Run time error '1004' aeddave Excel Worksheet Functions 1 January 30th 08 08:26 PM
Run Time Error '1004' Carpie Excel Discussion (Misc queries) 3 June 5th 06 07:04 PM
Run-time error '1004 shternm Excel Discussion (Misc queries) 7 October 3rd 05 07:38 PM
Run time error 1004, General ODBC error [email protected] New Users to Excel 0 September 19th 05 01:41 AM


All times are GMT +1. The time now is 09:01 PM.

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"