+ Reply to Thread
Results 1 to 5 of 5

Reorganize columns order

  1. #1
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Reorganize columns order

    Hello,
    I have a spreadsheet with multiple columns.

    The columns always have the following titles:
    Subject | Location | Width| Height |Ea|
    However, the columns are always organized in a random manner ( for ex, it could be
    Ea | Width| Location |Height | Subject| or any permutation).

    I need a macro to organize the columns by the order noted above, by shifting the title along with all the corresponding contents.

    I could write a cumbersome nested loop and “if” procedures, but I am sure, there is a simple way to do this.
    Any ideas?

    Thanks

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Reorganize columns order

    Try
    Change references(sheet names etc) as required
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Re: Reorganize columns order

    Nice!
    Thank you jolivanes!

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,528

    Re: Reorganize columns order

    Thank you for letting us know and good luck.

    Another possibility.
    Please Login or Register  to view this content.
    You can Insert and Delete whole columns but I prefer to use only whatever is required.

  5. #5
    Forum Guru
    Join Date
    04-23-2012
    Location
    New Jersey, USA
    MS-Off Ver
    Excel 365
    Posts
    2,416

    Re: Reorganize columns order

    The readers of this thread may find it interesting to find out that you can do what the OP wants without using any loops! As a matter-of-fact, you can do it with just a single line of code (albeit a rather long one)!
    Please Login or Register  to view this content.
    Last edited by Rick Rothstein; 07-18-2021 at 11:25 PM.

+ 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. How to order columns of Pivot table in correct month order
    By Cordelia123 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 04-23-2021, 08:29 AM
  2. Reorganize and add columns using a macro
    By boardumbfilms in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-05-2018, 01:22 PM
  3. [SOLVED] Need to reorganize - transpose columns to rows per article number
    By toblju in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 08-16-2012, 09:36 PM
  4. Macro to reorganize Columns base on Title
    By nkf531 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-24-2012, 01:52 PM
  5. Variables and Arrays To Reorganize Columns
    By GetSet in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-20-2011, 01:51 PM
  6. Need Macro to Compare Columns and then Reorganize Rows
    By WildSpreadsheets in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-12-2011, 11:03 PM
  7. Reorganize columns
    By deezed in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-02-2011, 10:31 PM

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