+ Reply to Thread
Results 1 to 5 of 5

Need help with copy rows and insert code...

  1. #1
    Registered User
    Join Date
    08-15-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Need help with copy rows and insert code...

    Hey everyone, I've got a spreadsheet that is layed out like this...

    col1 col2 col3
    row1 A 1 a1
    row2 data data data
    row3 data data data
    row4 data data data
    row5 A 2 a1
    row6 A 3 a1
    row7 B 1 a1

    What I'm trying to do is set up a VBA code that will take lines lines 2-4, copy the rows and then paste them in new rows every other row for the rest of the document, so that it appears as...

    col1 col2 col3
    row1 A 1 a1
    row2 data data data
    row3 data data data
    row4 data data data
    row5 A 2 a1
    row6 data data data
    row7 data data data
    row8 data data data
    row9 A 3 a1
    row10 data data data
    row11 data data data
    row12 data data data
    row13 B 1 a1
    row14 data data data
    row15 data data data
    row16 data data data

    I hope this makes sense! It has been so long since I used VBA that I may have fried my brain tyring to figure this out. Thanks in advance!
    Last edited by MrFleming007; 08-15-2009 at 06:01 PM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Need help with copy rows and insert code...

    try this:
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    08-15-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Need help with copy rows and insert code...

    worked perfect! Thanks!

  4. #4
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983

    Re: Need help with copy rows and insert code...

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save
    Please Read Forum Rules Before Posting
    Wrap VBA code by selecting the code and clicking the # icon or Read This
    How To Cross Post politely

    Top Excel links for beginners to Experts

    If you are pleased with a member's answer then use the Scales icon to rate it
    If my reply has assisted or failed to assist you I welcome your Feedback.

  5. #5
    Registered User
    Join Date
    08-15-2009
    Location
    Seattle, WA
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Need help with copy rows and insert code...

    Done!

+ 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