S
Shelly
Hi - I am trying to figure out the code to copy a range, paste it to the same
worksheet, sort the range, then copy the sorted data to another workhsheet.
This is what I have...
Private Sub ACSButton_Click()
ACSButton.Caption = "Click Here to Load ACS Services"
Worksheets("Solution Map").Activate
Worksheets("Solution Map").Range("Source1").Copy
ActiveSheet.Paste Destination:=Worksheets("Solution
Map").Range("Source2")
'Worksheets("Solution Map").Range("Source2").Select
'Worksheet("Solution Map").Range("Source2").Copy
Selection.Sort Key1:=Worksheets("Solution Map").Range("J36"),
Order1:=xlDescending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Selection.Copy
Worksheets("ACS").Activate
ActiveSheet.Paste Destination:=Worksheets("ACS").Range("Target")
Selection.PasteSpecial xlPasteValues
End Sub
But, it's giving me an 1004 error (The sort reference is not valid. Make
sure it's within the data you want to sort, and the first Sort By Box isn't
the same or blank.) on the "Selection.Sort" line.
Source1 is a named range in Solution Map
Source2 is the location where the copied data is pasted, the sorted, also in
Solution Map
I want to paste to a worksheet named ACS, to the named range "Target".
HELP!
worksheet, sort the range, then copy the sorted data to another workhsheet.
This is what I have...
Private Sub ACSButton_Click()
ACSButton.Caption = "Click Here to Load ACS Services"
Worksheets("Solution Map").Activate
Worksheets("Solution Map").Range("Source1").Copy
ActiveSheet.Paste Destination:=Worksheets("Solution
Map").Range("Source2")
'Worksheets("Solution Map").Range("Source2").Select
'Worksheet("Solution Map").Range("Source2").Copy
Selection.Sort Key1:=Worksheets("Solution Map").Range("J36"),
Order1:=xlDescending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Selection.Copy
Worksheets("ACS").Activate
ActiveSheet.Paste Destination:=Worksheets("ACS").Range("Target")
Selection.PasteSpecial xlPasteValues
End Sub
But, it's giving me an 1004 error (The sort reference is not valid. Make
sure it's within the data you want to sort, and the first Sort By Box isn't
the same or blank.) on the "Selection.Sort" line.
Source1 is a named range in Solution Map
Source2 is the location where the copied data is pasted, the sorted, also in
Solution Map
I want to paste to a worksheet named ACS, to the named range "Target".
HELP!