+ Reply to Thread
Results 1 to 4 of 4

Copy and Paste Multiple times and loop

Hybrid View

Dnass Copy and Paste Multiple times... 11-03-2013, 06:35 PM
alansidman Re: Copy and Paste Multiple... 11-03-2013, 06:51 PM
AB33 Re: Copy and Paste Multiple... 11-04-2013, 04:38 AM
Dnass Re: Copy and Paste Multiple... 11-05-2013, 08:44 PM
  1. #1
    Registered User
    Join Date
    11-03-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    22

    Copy and Paste Multiple times and loop

    Hello,

    I have a workbook with two Sheets.
    Sheet 1 has a list of Data which I want to copy into Sheet 2. Sheet 1's list is dynamic and the number of rows will always change. I want to be able to copy the data out of Sheet 1 starting from cell A2 and paste into Sheet 2 8 times so from cell A2 - A10, then move to the next one in Sheet 1 A3 copy to Sheet 2 A11 - A19.

    EG.

    Sheet 1

    A1
    Dog
    Cat
    Rabbit

    Sheet 2
    Dog
    Dog
    Dog
    Dog
    Dog
    Dog
    Dog
    Dog
    Cat
    Cat
    Cat
    Cat
    Cat
    Cat
    Cat
    Cat
    etc.

    I need this code to loop through Sheet 1 till it finds a break. Only one break will be present.

    Currently I am using 3 seperate codes, one which copys the data from Sheet 1 to Sheet 2 another code which inserts 7 rows under each line of data and the 3rd code copys the data however when it gets to the last row it does not know when to stop so keeps pasting down endlessly, alternatively if someone can help me with a solution in writing a code which I can let it know to stop pasting below is the code I am using.

    Sub CopyRows()
    '
    ' CopyRows Macro
    '
    
    '
    StartRow = 2
    
    Dim e As Range
    For Each e In ActiveSheet.UsedRange.Rows
    If Application.CountA(e) = 0 Then e.Value = e(0).Value
    If Range("A242") = False Then
    
    End If
    Next e
    End Sub
    Thanks heaps for the help!
    Last edited by Dnass; 11-21-2013 at 01:12 AM. Reason: code tags added

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 insider Version 2506 Win 11
    Posts
    24,771

    Re: Copy and Paste Multiple times and loop

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code.

    Posting code between [CODE] [/CODE] tags makes your code much easier to read and copy for testing, it also maintains VBA formatting.

    Highlight your code and click the # icon at the top of your post window. More information about these and other tags can be found here



    (I have added them this time. Please read all our rules and abide by them in the future.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Copy and Paste Multiple times and loop

    Dnass,
    Try the attached.
    Attached Files Attached Files

  4. #4
    Registered User
    Join Date
    11-03-2013
    Location
    Australia
    MS-Off Ver
    Excel 2007
    Posts
    22

    Re: Copy and Paste Multiple times and loop

    thank you will try this out

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 6
    Last Post: 12-15-2012, 05:08 PM
  2. [SOLVED] Copy & Paste Multiple Times
    By jkelly228 in forum Excel General
    Replies: 4
    Last Post: 08-10-2012, 03:54 PM
  3. Copy and paste multiple times
    By Axcelerate in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-26-2010, 09:24 AM
  4. Copy/Paste 30 Times or Loop?
    By GeorgY in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-18-2009, 12:33 PM
  5. Copy and paste rows multiple times
    By Novis in forum Excel General
    Replies: 5
    Last Post: 03-21-2009, 11:43 AM

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