+ Reply to Thread
Results 1 to 8 of 8

How to move every 11th column in row A2 to a new row

  1. #1
    Registered User
    Join Date
    05-07-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    How to move every 11th column in row A2 to a new row

    Hi,

    I have a data range of A2 to AQB2 and I would like to move every 11th column starting with K2 to the next row (so K2 to A3, U2 to A4, AE2 to A5, etc) -- or in other words keeping 10 columns per row.

    I've tried to copy the codes of other threads but cannot fill in the gaps as I am unfamiliar with excel code and just know the basics.

    If someone could help me out it would be very much appreciated!

    Thanks,

    Ben

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: How to move every 11th column in row A2 to a new row

    Do you want only the 11th column to be moved or from the 11th column to the 20th column, 21st to 30th column, etc?
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Registered User
    Join Date
    05-07-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: How to move every 11th column in row A2 to a new row

    Oh yes, sorry -- from the 11th to the 20th; 21st to 30th etc.

    Thanks!

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: How to move every 11th column in row A2 to a new row

    Try this code - it will take any number of columns till XFD (end of file).
    Please Login or Register  to view this content.
    Copy the Excel VBA code
    Select the workbook in which you want to store the Excel VBA code
    Hold the Alt key, and press the F11 key, to open the Visual Basic Editor
    Choose Insert | Module
    Where the cursor is flashing, choose Edit | Paste

    To run the Excel VBA code:
    Choose View | Macros
    Select a macro in the list, and click the Run button

  5. #5
    Registered User
    Join Date
    05-07-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: How to move every 11th column in row A2 to a new row

    Close! It must have to be tweaked just a bit -- it took the last set of 10 columns at the very end and moved them to A2 instead of moving Columns K-T to A3; U-AD to A4 and so forth.

    Am I explaining that clearly enough?
    Thanks for the help!

  6. #6
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: How to move every 11th column in row A2 to a new row

    Do you have any blank cells in between the data which then gets copied to column A?

    The macro determines the last row of data by checking column A. So if you have blank cells, the copying can go hay-wire.

  7. #7
    Registered User
    Join Date
    05-07-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: How to move every 11th column in row A2 to a new row

    Ah yes, exactly. I replaced all blank cells with XXX and the code worked perfectly! Thanks so much for your help! Very much appreciated!

    Cheers!

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: How to move every 11th column in row A2 to a new row

    Based on your last post in this thread, its apparent that you are satisfied with the solution(s) you've received and have solved your question, but you haven't marked your thread as "SOLVED". I will do it for you this time.

    In future, to mark your thread as Solved, you can do the following -
    Select Thread Tools-> Mark thread as Solved.

    Incase your issue is not solved, you can undo it as follows -
    Select Thread Tools-> Mark thread as Unsolved.

    Also, since you are relatively new to the forum, i would like to inform you that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post which helped you. This adds to the reputation of the person who has taken the time to help you.

+ 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