View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Problem with Sort Method After Paste

code ran fine for me.

after the code errors, can you go to Data=Sort and sort the selection
manually?

--
Regards,
Tom Ogilvy


"AmytDev" wrote:

Can anyone find out what is wrong with this code? I can't figure out why I
get error 1004 Sort Method of Range Class Failed when I click the custom
command button.

Sub Sort()
Range("B73:D85").Select
Selection.Copy
ActiveWindow.SmallScroll Down:=17
Range("B91:D103").Select
ActiveSheet.Paste Link:=True
Application.CutCopyMode = False
Range("B91:D103").Select
Selection.Sort Key1:=Range("B91"), Order1:=xlDescending, Header:=xlGuess _
, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub