0

Looking to augment my existing code to paste only values, and would like to change the copy range to select columns only.

Sub CopySort()

    Dim dEnd As Integer

    Sheets("Sorted").Range("A2:R250").ClearContents

    Sheets("Portfolio").Select

        Range("a1").Select

        dEnd = Selection.End(xlDown).Row

        Range("A5:" & "Z" & dEnd).Copy

    Sheets("Sorted").Select

        Range("A2").Select

        ActiveSheet.Paste

        Columns("A:R").Sort key1:=Range("A:A"), order1:=xlAscending, Header:=xlYes, _
                            key2:=Range("F:F"), order2:=xlAscending, Header:=xlYes, _
                            OrderCustom:=1, MatchCase:=False, _
                            Orientation:=xlTopToBottom, DataOption1:=xlSortNormal

    Application.CutCopyMode = False

End Sub
Community
  • 1
  • 1

0 Answers0