Results 1 to 3 of 3

Thread: Rearrange columns in a table
Thanks Thanks: 0 Likes Likes: 0

  1. #1
    New Member
    Join Date
    Jun 2013
    Posts
    44
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Rearrange columns in a table

    Hi All,

    I create a report where in I need to rearrange the columns in a particular manner as required by the client. Could you help me with a macro which will will work as per following criteria
    Column headers start from A1 onwards (the last column header might vary depending on the creator, I get the report from a different team)
    The number of rows of data might vary
    For changing the order of columns, the macro should look for a column with the header "Close Date", cut it and insert is before a column with header "Bookings". Then, the macro should look for a column with the header "Description", cut it and insert is before a column with header "Selling BU". The macro needs to then cut two adjacent columns namely "Sector" and "Sub-Area" and insert it before the column with header "Total Bookings"

    There will be several columns moved, if you give me the code for the above, I can modify it so that further column movements can be accommodated.


    Any help will be appreciated.

  2. #2
    Board Regular Trevor G's Avatar
    Join Date
    Jul 2008
    Location
    Tamworth, Staffordshire
    Posts
    6,362
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Rearrange columns in a table

    Have you tried recording a macro when you do this manually this will give you the code to run when you want to do it again.
    Trevor
    I am on a learning curve of life, I know a little but like to share what I have learnt with others.
    I am using Microsoft Office 2003 to 2016
    Please remember everyone here is a volunteer, so if you have had a reply to your thread be courteous and acknowledge this.

  3. #3
    New Member
    Join Date
    Jun 2013
    Posts
    44
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default Re: Rearrange columns in a table

    The columns are not static and keep changing. This macro will help move the columns no matter where they are in the table.

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
  •