+ Reply to Thread
Results 1 to 2 of 2

Move unknown number of headings into cells in new columns

  1. #1
    Registered User
    Join Date
    06-03-2015
    Location
    Odense, Denmark
    MS-Off Ver
    2010
    Posts
    1

    Move unknown number of headings into cells in new columns

    Hi,

    I have a sheet with a list of transactions. The headings for each account is listed above the transactions. In order to create a list, I need to move each heading to its own new column on each transaction line. These could be the headings:

    Account
    S3
    S4
    G1
    G2


    They are following by a number of transactions, each in a separate row. All transaction rows need to contain the headings for that specific account.

    I have figured out how to make it work when there are 5 headings, however, if my colleagues should also benefit from this macro, it needs to be changed so that there can be between 5 and 8 headings.

    I have also figured out how to create the right number of new columns, but I struggle with copying the headings to the cells in the new columns. This is the way I have done it when knowing the number of headings:

    Please Login or Register  to view this content.
    How do I do this when I do not know the number of headings?

    Best regards,
    LKottal

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Move unknown number of headings into cells in new columns

    Hi LKottal,

    Welcome to the Forum!

    Attach a sample workbook. Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

+ 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. Sum 12 Rows Unknown Number Of Columns
    By goss in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 12-28-2012, 08:34 AM
  2. Add a preset number of cells after unknown number of leading zeroes
    By Marweas in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 02-24-2012, 09:23 PM
  3. Replies: 3
    Last Post: 02-13-2012, 04:27 PM
  4. Sort unknown number of columns by row 1
    By rwqiii in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-27-2011, 04:42 PM
  5. Macro required to move Columns and addidng columns with headings
    By sponge_designs in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-03-2009, 08:20 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