Thread
:
Macro to pull every Nth row of data
View Single Post
#
5
Posted to microsoft.public.excel.programming
Amy
external usenet poster
Posts: 165
Macro to pull every Nth row of data
Many thanks to all...
This worked best for me.
Sub copyalternaterows()
Dim ds As Worksheet
Dim r As Long
Dim i As Long
Set ds = Sheets("Sheet6") 'destination
With Sheets("sheet7") ' source
r = 2
For i = 1 To .Cells(Rows.Count, 1).End(xlUp).Row Step 60
..Rows(i).Copy ds.Rows(r)
r = r + 1
Original Source: The Code Cage Forums
http://www.thecodecage.com/forumz/ex...tml#post563506
Next i
End With
End Sub
--
Don Guillett
Microsoft MVP Excel
SalesAid Software
"Amy" wrote in message
...
I have a spreadsheet of data and I need to pull every 60th row out onto
another sheet. Any simple macros?
Thanks.
I didn't go with the Offset fx because I have about 20 worksheets a week
that need this and I just want to push a button and it be done.
Thanks again.
Amy
"Jarek Kujawa" wrote:
you don't need a macro to achieve that
provided the data is in Sheet1!A1:A100 in Sheet2!B1 try this formula:
=OFFSET(Sheet1!$A$1,ROW()*60-1,)
drag down
On 19 Lis, 14:43, Amy wrote:
I have a spreadsheet of data and I need to pull every 60th row out onto
another sheet. Any simple macros?
Thanks.
.
Reply With Quote
Amy
View Public Profile
Find all posts by Amy