+ Reply to Thread
Results 1 to 2 of 2

Sorting Columns

Hybrid View

  1. #1
    Forum Contributor CobraLAD's Avatar
    Join Date
    07-23-2007
    Location
    Boksburg, South Africa
    MS-Off Ver
    Office 2019
    Posts
    346

    Sorting Columns

    Active sheet is Sheet1

    Using the following to sort on sheet7

        Sheet7.Select
        Columns("A:J").Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlGuess, _
            OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
            DataOption1:=xlSortNormal
    is there a way to sort on sheet7 without selecting it, I have tried to use

        sheet7.Columns("A:J").Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlGuess, _
            OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
            DataOption1:=xlSortNormal
    but the code does not work in that way
    Last edited by dominicb; 10-11-2007 at 06:17 AM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Please remember to follow the forum rules below. (check out rule 5)

    See if this helps

    With Sheets("Sheet7")
      .Range("A2").CurrentRegion.Sort Key1:=.Range("A2"), _
                Order1:=xlAscending, Header:=xlGuess, _
                OrderCustom:=1, MatchCase:=False, _
                Orientation:=xlTopToBottom
    End With
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1