+ Reply to Thread
Results 1 to 3 of 3

Macro to Transpose Data Based on Column Data

  1. #1
    Registered User
    Join Date
    06-24-2011
    Location
    LA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Macro to Transpose Data Based on Column Data

    Hello,

    I need help with a macro I've been trying to write with no success.

    I am attaching the sample worksheet.

    Basically, I have a table with bunch of data, with a header row on top. What I'd like to do, is take the data from column D as the criteria, and make a worksheet named after the data within D2, D3, D4, etc.

    After the sheet is created with that name, I need to copy the data from row 1, and paste transpose it to the new sheet in column A. With that, I also need to copy the data from the row, that D2 was taken from, and paste transpose it to column C as column B is just used for a spacer with a width of 1 (see the tab "B-Sample" in the attachment for an example of what I need it to look like).

    I need to do this for all remaining data in column D. So in essence, I would have tabs for Room #s, B1, B2, B3, B4, B5, displaying the "Report".

    My real excel file has a row header from A1:DM1.

    Can anyone assist with thsi?
    Attached Files Attached Files
    Last edited by xxmagnusxx; 06-24-2011 at 05:09 PM.

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Macro to Transpose Data Based on Column Data

    hi, xxmagnusxx, please check attachments:
    1. Code that works without template sheet and formats every sheet individually
    2. Code that copies template sheet that exists in the workbook
    activate Sheet1 and run "test"
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    06-24-2011
    Location
    LA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Macro to Transpose Data Based on Column Data

    Thanks! This was really helpful!

+ 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