+ Reply to Thread
Results 1 to 4 of 4

Select range and then transpose to a new worksheet

  1. #1
    Registered User
    Join Date
    07-10-2012
    Location
    NSW, Australia
    MS-Off Ver
    Excel 2010
    Posts
    76

    Select range and then transpose to a new worksheet

    Hello

    I have a large data set (40 000 rows) and what I am trying to do is to create a macro that will select the first 72 rows of data (starting from B12 in this case), and then transpose it to another worksheet. Then the next 72 rows will be selected and transposed directly below the first block of data, and so on until all 40 000 rows have been tranposed, 72 rows at a time.

    The blocks of data that I want to select are 72 rows by 26 columns, and so when they are tranposed they become 26 rows with 72 columns.
    Think of the data set as 40 000 continous rows, with data for each case occupying 72 rows, so in essence every 72 rows represents one case. I want to transpose this data one case at a time into a new work book.

    I have written the following macro (my macro skills are quite basic as you can see), it works nicely, except that I have to specify the code for each block. I need to incorporate some kind of loop that automatically moved the target range down 72 rows each time, and the paste cell for the transpose down 26 rows each time in the new work book. From the macro you can see that the first target data range starts is B12:AA83, and we go from there....

    Please Login or Register  to view this content.
    As you can see it works but so far it only covers 443 rows, i would need to repeat this about another 90 times to cover all the 40 000 rows.

    Can anyone help me with a more efficient solution?

    I thank you in advance for your assistance.

  2. #2
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,594

    Re: Select range and then transpose to a new worksheet

    PL TRY THIS CODE.


    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    07-10-2012
    Location
    NSW, Australia
    MS-Off Ver
    Excel 2010
    Posts
    76

    Re: Select range and then transpose to a new worksheet

    That code seems to work very nicely. Thank you very much. I am really grateful for your assistance!!

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,594

    Re: Select range and then transpose to a new worksheet

    Thanks for compliments.
    Pl mark the thread SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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