Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can I move every 5th value in a column of data to another
worksheet? Also, Is it possible to define a start/stop point for this? Any help is greatly appreciated. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Please try this macro. Sub Move_Every_Fifth() Dim LastRow As Long, LastRowDestSheet As Long Dim i As Long, srcSht As Worksheet Dim DestSht As Worksheet Set srcSht = ActiveSheet Set DestSht = Sheets("Sheet2") LastRow = srcSht.Cells(Rows.Count, 1).End(xlUp).Row For i = 1 To LastRow Step 5 If i = 1 Then LastRowDestSheet = DestSht.Cells(DestSht.Rows.Count, 1).End(xlUp).Row Else LastRowDestSheet = DestSht.Cells(DestSht.Rows.Count, 1).End(xlUp).Row + 1 End If DestSht.Cells(LastRowDestSheet, 1).Value = Cells(i, 1).Value Next i End Sub If you need any help with this please revert. -- Anant " wrote: How can I move every 5th value in a column of data to another worksheet? Also, Is it possible to define a start/stop point for this? Any help is greatly appreciated. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This can be done without VBA:
In a helper column near your dta enter: =MOD(ROW(),5) and copy down. You should see a sequence like: 2 3 4 0 1 2 3 4 0 1 2 3 etc. (not necessarily starting with 2). Then switch on AutoFilter. You can then select every fifth line for copy/paste with arbitrary phasing. -- Gary's Student " wrote: How can I move every 5th value in a column of data to another worksheet? Also, Is it possible to define a start/stop point for this? Any help is greatly appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
numbers in a column and it changes when I move to the next column | Excel Discussion (Misc queries) | |||
how to move the cursor to column A after entering data column F | New Users to Excel | |||
move contents of column C based on criteria related to column A | Excel Discussion (Misc queries) | |||
move column headings from row to column | Excel Worksheet Functions | |||
Move Cell in Column A to Column B when FIND | Excel Programming |