D. Day
D. Day

Reputation: 1

Copy/Paste Special loop in VBA

Very new to VBA and trying to do a simply copy/paste special loop. How would you write the code so that each time it loops it copies one cell down in the Filter Out Pitchers tab and pastes special one cell down in the Batter Comparison tab?

Sub Hitters()

    For i = 1 To 500
        Worksheets("Filter Out Pitchers").Range("B2").Copy
        Worksheets("Batter Analysis").Paste _
        Destination:=Worksheets("Batter Analysis").Range("B1")
        Worksheets("Batter Analysis").Range("A88:AA88").Copy
        Worksheets("Batter Comparison").Range("A2:AA2").PasteSpecial xlPasteValues
    Next i
End Sub

Upvotes: 0

Views: 916

Answers (1)

A.S.H
A.S.H

Reputation: 29332

Not sure I understood completely, but this may be what you're after:

For i = 1 To 500
    Worksheets("Filter Out Pitchers").Range("B" & (1+i)).Copy _
        Destination:=Worksheets("Batter Analysis").Range("B2")
    Worksheets("Batter Comparison").Range("A" & (1+i) & ":AA" & (1+i)).Value = _
        Worksheets("Batter Analysis").Range("A88:AA88").Value
Next i

Upvotes: 2

Related Questions