Results 1 to 8 of 8

Code to Copy Data to Every nth Row

Threaded View

  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.

    Sub test()
    Dim LR As Long, i As Long
    'Set LR = Sheet7.Range("C721")
    LR = Range("C721", Rows.Count).End(xlUp).Row
    Range("AB1:AC1").Copy
    For i = 4 To LR Step 4
        Range("C11" & i).PasteSpecial Paste:=xlPasteValues
    
    Next i
    End Sub
    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] .

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