Grabbing info from every 6 rows

  • Thread starter Thread starter mcolson
  • Start date Start date
M

mcolson

I would like to have cell B1 equal the contents of A1, B2 = A7, B3 =
A13 and so on. Basically, I'm trying to grab the values from every 6
cells in column A. Does anyone know how to do this? I was hoping I
could do something like B1 = A'I1', and then copy and past this to all
the subsequent b cells. I1 would equal 1, I2 would equal 6, I3 would
equal 13 and so on.
 
=INDEX(A:A,ROW()*6-5)

--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)
 
try
Sub every6rows()
Columns(2).ClearContents
interval = 6
For i = 1 + interval To Cells(Rows.Count, "a") _
.End(xlUp).row Step interval
Cells(i - interval, "b").Value = Cells(i, "a")
Next
End Sub
 
correction
Sub every6rows()
Columns(2).ClearContents
interval = 6
ii = 1
For i = 1 + interval To Cells(Rows.Count, "a") _
.End(xlUp).row Step interval
Cells(ii, "b") = Cells(i, "a")
ii = ii + 1
Next
End Sub
 
Back
Top