Results 1 to 10 of 14

Thread: Swapping (Rearranging) Multiple Columns of Data

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Senior Member
    Join Date
    Jun 2012
    Posts
    337
    Rep Power
    12
    Quote Originally Posted by Rick Rothstein
    With your method, I would have to know where the column will end up at after the sort
    I don't think so. It's meant to use the same method you use to indicate the order of the columns.

    I also added a oneliner alternative in case the currentregion/usedrange doesn't consist of more than 26 columns.
    Last edited by snb; 08-11-2012 at 06:46 PM.

  2. #2
    Forum Guru Rick Rothstein's Avatar
    Join Date
    Feb 2012
    Posts
    659
    Rep Power
    13
    Quote Originally Posted by snb View Post
    I don't think so. It's meant to use the same method you use to indicate the order of the columns.
    Sorry, you are correct... we both are using the same method for delineating the order for the rearranged columns. I thought I had detected a "relationship" between our two posted "new order" example strings and responded based on that. I just tested your code and it works quite well also, although I would note your code requires the insertion and removal of a helper column to do its work (no big deal that, just pointing out a difference between our methods as it affects the sheet being processed). One personal observation... I really wish you would declare your variables (I use Option Explicit in all my procedures and had to disable it in order to stop the error it generates when testing your code).

Similar Threads

  1. Replies: 2
    Last Post: 03-05-2013, 07:34 AM
  2. Converge Data From Multiple Columns To Single Column
    By ayazgreat in forum Excel Help
    Replies: 3
    Last Post: 12-14-2012, 10:55 PM
  3. Swapping columns Error 2
    By jomili in forum Excel Help
    Replies: 1
    Last Post: 11-16-2012, 08:52 PM
  4. Swapping Multiple Columns of Data
    By jomili in forum Excel Help
    Replies: 5
    Last Post: 10-01-2012, 05:56 PM
  5. Replies: 2
    Last Post: 06-14-2012, 04:10 AM

Tags for this Thread

Posting Permissions

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