+ Reply to Thread
Results 1 to 8 of 8

Rearrange column with fixed headers

  1. #1
    Forum Contributor
    Join Date
    05-09-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    212

    Rearrange column with fixed headers

    Raw tab is raw data generated from system. Every time I need to manually copy and paste to remove the columns become result tab header.

    How to write VBA code to skip the manual workaround?

    Help.
    Attached Files Attached Files
    Last edited by Shermaine2010; 12-28-2016 at 08:16 AM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Rearrange column with fixed headers

    Record a macro where you move\copy\delete your columns.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,519

    Re: Rearrange column with fixed headers

    Heres one way using a User Defined Type array. Maybe over kill but easy to read and if you decide to Rearrange the output in the future will be easy to update.

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  4. #4
    Forum Contributor
    Join Date
    05-09-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    212

    Re: Rearrange column with fixed headers

    Quote Originally Posted by AlphaFrog View Post
    Record a macro where you move\copy\delete your columns.
    The columns will be changed once I moved to back.
    Example: Allowance Code is column I. After moved it next to name, Allowance Code at column C. The rest of column will changes. Continues, the rest of column will keep changing once I move one fields.
    I can't fix the column B:B or C:C into VBA code.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Rearrange column with fixed headers

    If I understand the requirement then isn't a simple advanced filter the obvious choice.

    i.e.

    Please Login or Register  to view this content.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  6. #6
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Rearrange column with fixed headers

    Quote Originally Posted by Shermaine2010 View Post
    The columns will be changed once I moved to back.
    Example: Allowance Code is column I. After moved it next to name, Allowance Code at column C. The rest of column will changes. Continues, the rest of column will keep changing once I move one fields.
    I can't fix the column B:B or C:C into VBA code.
    Yes you can. Give it a try. It's easy to test.

  7. #7
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Rearrange column with fixed headers

    Quote Originally Posted by Shermaine2010 View Post
    The columns will be changed once I moved to back.
    Example: Allowance Code is column I. After moved it next to name, Allowance Code at column C. The rest of column will changes. Continues, the rest of column will keep changing once I move one fields.
    I can't fix the column B:B or C:C into VBA code.
    Yes you can. Give it a try. It's easy to test.

  8. #8
    Forum Contributor
    Join Date
    05-09-2010
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    212

    Re: Rearrange column with fixed headers

    Quote Originally Posted by AlphaFrog View Post
    Yes you can. Give it a try. It's easy to test.
    Yes. I got it with the code provided by you. Thanks

+ 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. Replies: 1
    Last Post: 03-06-2009, 12:45 PM
  2. Column Headers Not Fixed
    By Dave Peterson in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 09-06-2005, 07:05 PM
  3. [SOLVED] Column Headers Not Fixed
    By Dave Peterson in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 09-06-2005, 05:05 PM
  4. Column Headers Not Fixed
    By Cabby in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 PM
  5. [SOLVED] Column Headers Not Fixed
    By Cabby in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 11:05 AM
  6. [SOLVED] Column Headers Not Fixed
    By Cabby in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 02:05 AM
  7. [SOLVED] Column Headers Not Fixed
    By Cabby in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 01:05 AM
  8. [SOLVED] Column Headers Not Fixed
    By Cabby in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 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