+ Reply to Thread
Results 1 to 7 of 7

Excel VBA macro to select range separated by blank row and copy to next empty column

  1. #1
    Registered User
    Join Date
    01-29-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    12

    Excel VBA macro to select range separated by blank row and copy to next empty column

    Hello experts, I have been searching and searching for a solution and I can't get this to work. Like the title says I need a macro to select range separated by blank row and copy to next empty column. I'm really new to VBA so I need some help.

    example:

    DATE1 TIME1 MISC1
    012313 17:03 0.0
    012313 17:03 0.0
    012313 17:03 0.0

    DATE2 TIME2 MISC2
    012313 17:03 0.0
    012313 17:03 0.0
    012313 17:03 0.0

    DATE3 TIME3 MISC3
    012313 17:03 0.0
    012313 17:03 0.0
    012313 17:03 0.0

    Would like following result:

    DATE1 TIME1 MISC1 DATE2 TIME2 MISC2 DATE3 TIME3 MISC3
    012313 17:03 0.0 012313 17:03 0.0 012313 17:03 0.0
    012313 17:03 0.0 012313 17:03 0.0 012313 17:03 0.0
    012313 17:03 0.0 012313 17:03 0.0 012313 17:03 0.0

    Basically transpose range to next available column. Is this doable?

    Any help will be greatly appreciated...

    Thanks

  2. #2
    Registered User
    Join Date
    01-29-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Excel VBA macro to select range separated by blank row and copy to next empty column

    I was able to copy the range to another sheet but I have no idea how to loop and do all of them and having a hard time copying to the same sheet.

    I used:

    Please Login or Register  to view this content.

    Thanks...
    Last edited by hackini; 01-29-2013 at 01:38 AM.

  3. #3
    Registered User
    Join Date
    01-29-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Excel VBA macro to select range separated by blank row and copy to next empty column

    Ok, I tried this is kinda what I need except colums and not rows.

    Please Login or Register  to view this content.
    Thanks again...
    Last edited by hackini; 01-29-2013 at 01:38 AM.

  4. #4
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Excel VBA macro to select range separated by blank row and copy to next empty column

    You need to edit your posts and wrap the vba code with the code tag.
    It is a MUST rule here.
    i.e
    [code]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/code]


    See if this is what you wanted

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    01-29-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Excel VBA macro to select range separated by blank row and copy to next empty column

    @jindon
    Thanks for your reply and sorry about not wrapping the code.

    You are a great help This is just what I need except I would like to move the data instead of copying it.

    Thanks again...

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,834

    Re: Excel VBA macro to select range separated by blank row and copy to next empty column

    Thanks for the code tag.

    Then use cut instead
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    01-29-2013
    Location
    US
    MS-Off Ver
    Excel 2007
    Posts
    12

    Re: Excel VBA macro to select range separated by blank row and copy to next empty column

    Thanks jindon
    You are a genius. Works perfect. I tried to change copy to cut but kept getting errors.

    Thanks again for your prompt reply....

+ 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