Formula offscopy and offset

J

JD

Hi,

I am trying to get the sum of three cells (always the same amount of
columns apart; J10, S10, AB10) on a different spreadsheet onto another
spreadsheet (in the same workbook) and then automatically apply this
same process, selecting another sequence moved to start the same amount
of columns again (AK10, AT10, BC10), but moved nine columns on the
destination spreadsheet.

My code is below, but it only moves the formula copy to S10, AB10,
AK10.

Any help would be appreciated.
//-->
Dim Lastrow As Long

Sheets("Sheet2").Activate
Lastrow = ActiveSheet.Cells(Rows.Count, "A").End(xlUp).Row
Range("L4").Select
Range("L4").Formula = "=SUM(Score!J10,Score!S10,Score!AB10)"
Range("L4:L" & Lastrow).FillDown
Set rngCopy = Range("L4:L" & Lastrow)
Set rngPaste = Range("U4")
For n = 1 To 4
rngCopy.SpecialCells(xlCellTypeFormulas, 23).Copy
rngPaste.PasteSpecial Paste:=xlPasteFormulas
Set rngPaste = rngPaste.Offset(0, 9)
Next n
Set rng = Range(Range("L4"), Range("L4").End(xlDown))
For i = 0 To 27
rng.Offset(0, 9).FillDown
Next
-->//
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top