Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a macro in an Access database that opens a new Excel workbook and
writes data to a sheet in the workbook. The macro then does "stuff" to the data (sort, total, etc.) I'm receiving an error message when the macro sorts. The message I get is: "Method 'Range' of object_Global' Failed". Following is the code used to sort the data: ..Range("A1").Select ..Range(.ActiveCell, .ActiveCell.Offset(0, 2)).Select ..Range(.Selection, .Selection.End(xlDown)).Select ..Selection.Sort Key1:=Range("B2"), Order1:=xlAscending, Key2:=Range("C2") _ , Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _ False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _:=xlSortNormal ..Range("A1").Select I don't get this error all of the time. Is there anything I can change or add to the code so I don't get this error. Thanks for the help and suggestions.......... -- JT |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
error message: compile error, argument not optional | Excel Programming | |||
VBA Error Message "Compile Error...." | Excel Discussion (Misc queries) | |||
Excel XP error message Run Time Error 91 | Excel Programming | |||
changing the message in an error message | Excel Worksheet Functions | |||
How do I get rid of "Compile error in hidden module" error message | Excel Discussion (Misc queries) |