+ Reply to Thread
Results 1 to 3 of 3

Excel 2007 : Macro to copy columns based headers

  1. #1
    Registered User
    Join Date
    04-22-2011
    Location
    Beaverton, Oregon
    MS-Off Ver
    Excel 2007
    Posts
    6

    Macro to copy columns based headers

    Hi, I want to copy data from one sheet to another based on the headers.

    I have 3 sheets, on the ranking tab I am ranking the orders, and on the raw data I have a formula in cells B1:G1 that bring that rank over.

    I need to be able to click a button anytime I change the ranking tab so that the columns copy to the hierarchy in the order I have column B1:G1.

    I have attached what it should look like...since I ranked "Grapes" as 1, then raw data shows a 1 in the first row and it would copy to the "1" column on hierarchy with the macro.
    Attached Files Attached Files
    Last edited by rls1316; 04-24-2011 at 11:58 PM.

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Macro to copy columns based headers

    You don't really need VBA for this as formulae could do the same pretty efficiently.

    Using your sample change Hierarchy sheet as follows:

    Please Login or Register  to view this content.
    As you alter Ranking list so the Hierarchy sheet will update accordingly.

  3. #3
    Registered User
    Join Date
    04-22-2011
    Location
    Beaverton, Oregon
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Macro to copy columns based headers

    Thank you!!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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