+ Reply to Thread
Results 1 to 1 of 1

Thread: Modify code to drag cell contents across a row range

  1. #1
    Valued Forum Contributor
    Join Date
    01-05-2010
    Location
    New York
    MS-Off Ver
    Excel 2010
    Posts
    706

    Modify code to drag cell contents across a row range

    My code at this point copies the forumla in cells JI104 and I 105 every seven rows down column JI. Is there a way to add to my code to drag the formulas in JI104 to Q104 and JI 105 to AU 104. I need the code to repeat this procedure for the next example JI111 and JI112 and so on..

    How can I add this to the code?


    
    
    Private Sub CopySTDEVCalc()
    Dim shtR As Worksheet, shtL As Worksheet, i As Long
    Dim shtS As Worksheet
    Dim rCopy As Range, rStep3 As Range
    Dim pRow As Long
    
    Set shtR = Sheets("Raw Price Data")
    Set shtL = Sheets("Raw Price Data Long")
    Set shtS = Sheets("Raw Price Data Short")
    
    Range("B1").Resize(2, 1).Select
    Copy
    Range("JI104").Select
    Paste
    
    i = 104
    
    Do Until shtL.Cells(i + 5, 3) = ""
        
        Set rCopy = shtL.Cells(i, 269).Resize(2, 1)
    
             If shtL.Cells(i, 3).End(xlDown).Row < 109 Then
                rCopy.Copy Destination:=shtL.Cells(111, 269)
    
            Else
                rCopy.Copy Destination:=shtL.Cells(i + 7, 269)
            End If
    
        i = i + 7
    Loop
    
    End Sub
    Attached Files Attached Files

+ 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.2.0