Results 1 to 3 of 3

Thread: macro to rearrange columns
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Jul 2017
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default macro to rearrange columns

    hey, first time posting here if you require more information let me know. I have a spreadsheet that I want to make a macro to rearrange columns to be in a specific order, it's easy to do if the columns are always in the same spot, i could just record a macro and run it but I want this to be useable for multiple different users and depending on their individual preferences the columns will be in a different order

    for example I want columns in order of column A, B, C, D etc
    user1 may have columns in order of B, D, A, C and user 2 may have it in C, B, D, A.

    luckily the column header names will always be consistant, can someone point me to a macro that will rerrange columns based on the column header and always put them in the same order? so if i run the macro on user1 or user2's spreadsheet it'll rearrange the data to the order I want.

    sorry if this doesn't make sense, i'm just teaching myself how to do VB script lol, i've managed to make a script to format and highlight specific cells but i can't figure out how to do this.

  2. #2
    MrExcel MVP
    Moderator
    Fluff's Avatar
    Join Date
    Jun 2014
    Location
    Chippenham
    Posts
    28,203
    Post Thanks / Like
    Mentioned
    470 Post(s)
    Tagged
    47 Thread(s)

    Default Re: macro to rearrange columns

    Take a look at post#6 here
    Reorder columns using a macro
    - Posting Data try one of these tools
    - Posting guidelines, forum rules and terms of use
    - Read the FAQs

    Running Office 365 on Win 10

  3. #3
    New Member
    Join Date
    Jul 2017
    Posts
    13
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: macro to rearrange columns

    Quote Originally Posted by Fluff View Post
    Take a look at post#6 here
    Reorder columns using a macro
    great that looks like it should do the trick, i'll give it a shot this morning.

Some videos you may like

User Tag List

Tags for this Thread

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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