+ Reply to Thread
Results 1 to 8 of 8

Code to Copy Data to Every nth Row

  1. #1
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Question Code to Copy Data to Every nth Row

    Hello to all of you,


    I have some code that I cannot get to work. Maybe the problem lies with LR.

    On Sheet7 of my WorkBook, I have Data in Cells AB1 and AC1 which I want to copy to Cell C11 and D11 respectively, and then down every 4th Row but not further down than Row719.

    Please Login or Register  to view this content.
    Can someone please help me out here?

    Thank you!
    Last edited by Winon; 01-07-2012 at 05:39 PM. Reason: Solved
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Code to Copy Data to Every nth Row

    Please Login or Register  to view this content.



  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Code to Copy Data to Every nth Row

    Try:

    Please Login or Register  to view this content.

    Regards
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Code to Copy Data to Every nth Row

    Thank you guys,


    Hello snb,

    Hope you have enjoyed a wonderful festive season. Your code is very close to what I want. The only thing is that it goes way beyond Row 719 which is were I want to stop, otherwise it corrupts data further down Columns C & D.
    It also runs slow.

    @ TMShucks,

    I have tried that, and it does not stop at Row 719. Most of the time it will only paste the data in Row 114.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,447

    Re: Code to Copy Data to Every nth Row

    Maybe best if you post sample an indicate the start and end positions.

    Regards

  6. #6
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Code to Copy Data to Every nth Row

    Thank you TMShucks,

    Here you go. I did not include my non working vba code.

    Thank you for your time, and willingness to have a look at it for me!

    In this sample sheet7 as referred to in my post will of course be Sheet1.
    Last edited by Winon; 01-07-2012 at 05:53 PM. Reason: Remove WorkBook. Thread Solved

  7. #7
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Code to Copy Data to Every nth Row

    Please Login or Register  to view this content.
    Last edited by snb; 01-07-2012 at 03:41 PM.

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Code to Copy Data to Every nth Row

    Hallo snb,

    Baie Dankie,

    That is what I like about you. You seem to be like a Pitbull. Once you take hold of something you don't let go!!!

    Your code works perfect, Short and sweet and fast. All I had to do was to change the 708 to 712 to get it working down to row 719. I shall promptly mark the thread as solved.

    May I suggest you seriously consider adding this to your samples of code on your Site.

    Thank you so MUCH!!!

+ 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