View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
HI HI is offline
external usenet poster
 
Posts: 5
Default Loop to specific rows

Don't know if this is what you wanted. Following macro will add number
1 on cells C7, D7 to H7 and C12, D12 ... H12 etc.
You replace the 1 with your formula

Sub TEST()
Range("C7").Select
For i = 0 To 10
For j = 0 To 5
ActiveCell.Offset(i * 5, j).Value = 1
Next j
Next i
End Sub





On 26 syys, 16:52, Omar wrote:
I need to write a macro that copies cells in a specific row and then
loops to the next row, next row being 5 rows below.

So, copy cells C7, D7 to H7
then, Copy the next set C12, D12 ... H12
and so on.

I would assume this would be done using 2 loops, one for goings
through the columns and one for the rows, but I could be wrong.

I am not sure of the syntax, so if anyone can give me some tips, that
would be great.
Thanks.