+ Reply to Thread
Results 1 to 4 of 4

Code to sort Identical Headings in Different Sheets

Hybrid View

hammer2 Code to sort Identical... 02-03-2016, 12:07 AM
hammer2 Re: Code to sort Identical... 02-04-2016, 04:11 AM
jindon Re: Code to sort Identical... 02-04-2016, 05:01 AM
hammer2 Re: Code to sort Identical... 02-04-2016, 05:19 AM
  1. #1
    Forum Contributor
    Join Date
    06-25-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016
    Posts
    615

    Code to sort Identical Headings in Different Sheets

    Hi Folks

    I have two sheets in the same Workbook that have identical Headings- but they are in differing Col order-

    Is it possible to sort sheet 2 Cols to the same Col order as they appear in sheet 1 ?


    Cheers
    hammer
    If you have found solving my problem/s to be an interesting and educational exercise then how about Repping me up?
    No idea why I need Rep, other than feeling left out....

  2. #2
    Forum Contributor
    Join Date
    06-25-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016
    Posts
    615

    Re: Code to sort Identical Headings in Different Sheets

    Bumper

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Code to sort Identical Headings in Different Sheets

    Try
    Sub test()
        Dim rng As Range
        With Sheets("sheet2").Cells(1).CurrentRegion
            Set rng = .Offset(, .Columns.Count)
            Sheets("sheet1").Cells(1).CurrentRegion.Rows(1).Copy rng.Cells(1)
            .AdvancedFilter 2, rng, rng
            .EntireColumn.Delete
        End With
    End Sub

  4. #4
    Forum Contributor
    Join Date
    06-25-2011
    Location
    Sydney
    MS-Off Ver
    Excel 2016
    Posts
    615

    Re: Code to sort Identical Headings in Different Sheets

    Brilliant!

    Thank you for your time and expertise jindon!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Sorting data from a table with identical column headings
    By Stephen23 in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 03-11-2015, 09:27 AM
  2. Replies: 6
    Last Post: 12-18-2013, 09:11 PM
  3. Use sort method to sort ranges based on their headings using vba
    By kris nuvio in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-01-2013, 07:54 AM
  4. consolidate 75 workbooks - identical headings
    By lray in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 11-10-2011, 05:53 PM
  5. Replies: 1
    Last Post: 03-23-2011, 06:49 AM
  6. why cant i get identical sort from identical code
    By jimb0693 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-07-2010, 01:04 PM
  7. Amend code to Sort Sheets by number
    By hutch@edge.net in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-02-2008, 09:03 AM

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