+ Reply to Thread
Results 1 to 5 of 5

macro to transpose col A every 4 rows to Col B,C etc

  1. #1
    Registered User
    Join Date
    04-20-2008
    Posts
    2

    macro to transpose col A every 4 rows to Col B,C etc

    Hey everyone im sort of in a pinch and need some help here.

    I need a macro that will take all the data in a column no matter how long and put every 4th row in that column into a new column.

    I've tried fooling around but im not that good with macros. They only way i can think to approach this is something like this....

    Please Login or Register  to view this content.
    then just go one forever.. but that would take longer than i would like.

    Thanks in advance.
    Last edited by VBA Noob; 04-20-2008 at 05:50 PM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hello owensr,

    Welcome to the forum.

    Could I ask next time to
    1) Provide a more searchable title. I've amended for you
    2) Wrap your code. Again I've done for you (See link below for more)
    3) Post to the correct forum. Moved from Functions to Programming.

    See if the below helps. It copy's it first then clears col A

    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Quote Originally Posted by owensr
    Hey everyone im sort of in a pinch and need some help here.

    I need a macro that will take all the data in a column no matter how long and put every 4th row in that column into a new column.

    I've tried fooling around but im not that good with macros. They only way i can think to approach this is something like this....

    Please Login or Register  to view this content.
    then just go one forever.. but that would take longer than i would like.

    Thanks in advance.
    Hi,
    The following should work. You might want to put a test in to check that you've not got more than 1020 rows causing the macro to fall over when it tries to go past the 256th column IV.

    Please Login or Register  to view this content.
    Rgds

  4. #4
    Registered User
    Join Date
    04-20-2008
    Posts
    2
    Quote Originally Posted by Richard Buttrey
    Hi,
    The following should work. You might want to put a test in to check that you've not got more than 1020 rows causing the macro to fall over when it tries to go past the 256th column IV.

    Please Login or Register  to view this content.
    Rgds
    Wow that works well. How would i alter this macro to include the three rows under the one thats being copied into the corresponding column. say every 4 rows as in rows 1-4 5-8, ect... Sorry for the confusion question.

  5. #5
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464
    Quote Originally Posted by owensr
    Wow that works well. How would i alter this macro to include the three rows under the one thats being copied into the corresponding column. say every 4 rows as in rows 1-4 5-8, ect... Sorry for the confusion question.
    Hi,

    Just change it to the following:
    Please Login or Register  to view this content.
    Rgds

+ 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