Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thanks, works great now.
On Mar 9, 1:19 pm, Dave Peterson wrote: One more followup... So when you write: range("e5:M17").select it's refering to the sheet with the commandbutton--not Table And since you're trying to select a range on a non-active sheet (the sheet with the commandbutton), you get the error. wrote: I have some code that works from a keyboard shortcut, but when I try to attach it to a command button on another worksheet is delivers the above error. Code is below, please help! Sheets("Table").Activate Range("E5:M17").Select Selection.Sort Key1:=Range("M6"), Order1:=xlDescending, Key2:=Range("L6") _ , Order2:=xlDescending, Key3:=Range("J6"), Order3:=xlDescending, Header _ :=xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom _ , DataOption1:=xlSortNormal, DataOption2:=xlSortNormal, DataOption3:= _ xlSortNormal Range("A1").Select -- Dave Peterson- Hide quoted text - - Show quoted text - |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Method 'MacroOptions' of object'_Application' failed Runtime Error 1004 | Excel Discussion (Misc queries) | |||
Run-time error "1004" Select method of range class failed | Excel Discussion (Misc queries) | |||
Charts.Add error '1004' Method 'Add' of object 'Sheets' failed | Charts and Charting in Excel | |||
Error: method 'select' of object_worksheet' failed | Excel Discussion (Misc queries) | |||
runtime error 1004 method range of object '_global failed | Excel Discussion (Misc queries) |