Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Run time error '1004'
I assigned a recorded macro to an object. When clicked it sorts range
A12:A2500. It works fine until I turn on sheet protection. The range is not protected, nor is the object. I receive the error above with "Sort method of range class failed". Debugging shows below with "Selection....normal" highlighted. Any help is appreciated Sub SortByType() ' ' SortByType Macro ' Macro recorded 1/29/2008 by mcgind1 ' ' Range("A12").Select Application.Goto Reference:="R12C1:R5000C7" Selection.Sort Key1:=Range("B12"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal Range("A12").Select End Sub |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Run time error '1004'
If you know the password, just have your sort routine unprotect the worksheet,
sort the data and reprotect the sheet. aeddave wrote: I assigned a recorded macro to an object. When clicked it sorts range A12:A2500. It works fine until I turn on sheet protection. The range is not protected, nor is the object. I receive the error above with "Sort method of range class failed". Debugging shows below with "Selection....normal" highlighted. Any help is appreciated Sub SortByType() ' ' SortByType Macro ' Macro recorded 1/29/2008 by mcgind1 ' ' Range("A12").Select Application.Goto Reference:="R12C1:R5000C7" Selection.Sort Key1:=Range("B12"), Order1:=xlAscending, Header:=xlGuess, _ OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _ DataOption1:=xlSortNormal Range("A12").Select End Sub -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
run time error 1004 | Excel Worksheet Functions | |||
Run time error 1004 | Excel Discussion (Misc queries) | |||
Run time error 1004 | Excel Discussion (Misc queries) | |||
Run-time error '1004 | Excel Discussion (Misc queries) | |||
Run time error 1004, General ODBC error | New Users to Excel |