Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to add three seperate groups
I have a worksheet that has over 1,000 rows with no labels. The first three
columns have the same labels. Here is what I would like to do: I would like to create 3(three) worksheets by picking the following: 1St group (tab) would include rows 1, 4, 7, 10, 13 etc. adding the 3rd row to the end. 2nd group (tab) would include rows 2, 5, 8, 11, 14, etc. adding the 3rd row to the end 3rd group (tab) would include rows 3, 6, 9, 12, etc. adding the 3rd row to the end. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to add three seperate groups
This code is very simple, but works.
"Beep Beep" wrote: I have a worksheet that has over 1,000 rows with no labels. The first three columns have the same labels. Here is what I would like to do: I would like to create 3(three) worksheets by picking the following: 1St group (tab) would include rows 1, 4, 7, 10, 13 etc. adding the 3rd row to the end. 2nd group (tab) would include rows 2, 5, 8, 11, 14, etc. adding the 3rd row to the end 3rd group (tab) would include rows 3, 6, 9, 12, etc. adding the 3rd row to the end. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to add three seperate groups
This code is very simple, but work extremely well
Sub move_rows() Set MasterSheet = ActiveSheet With MasterSheet Lastrow = .Cells(Rows.Count, "A").End(xlUp).Row For movesheet = 3 To 1 Step -1 MoveRowCount = 1 Worksheets.Add after:=Worksheets(.Index) 'newworksheet is now actrive sheet For RowCount = movesheet To Lastrow Step 3 .Rows(RowCount).Copy Destination:=ActiveSheet.Rows(MoveRowCount) MoveRowCount = MoveRowCount + 1 Next RowCount Next movesheet End With End Sub "Beep Beep" wrote: I have a worksheet that has over 1,000 rows with no labels. The first three columns have the same labels. Here is what I would like to do: I would like to create 3(three) worksheets by picking the following: 1St group (tab) would include rows 1, 4, 7, 10, 13 etc. adding the 3rd row to the end. 2nd group (tab) would include rows 2, 5, 8, 11, 14, etc. adding the 3rd row to the end 3rd group (tab) would include rows 3, 6, 9, 12, etc. adding the 3rd row to the end. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to add three seperate groups
Thanks Joel:
Worked like a charm "Joel" wrote: This code is very simple, but work extremely well Sub move_rows() Set MasterSheet = ActiveSheet With MasterSheet Lastrow = .Cells(Rows.Count, "A").End(xlUp).Row For movesheet = 3 To 1 Step -1 MoveRowCount = 1 Worksheets.Add after:=Worksheets(.Index) 'newworksheet is now actrive sheet For RowCount = movesheet To Lastrow Step 3 .Rows(RowCount).Copy Destination:=ActiveSheet.Rows(MoveRowCount) MoveRowCount = MoveRowCount + 1 Next RowCount Next movesheet End With End Sub "Beep Beep" wrote: I have a worksheet that has over 1,000 rows with no labels. The first three columns have the same labels. Here is what I would like to do: I would like to create 3(three) worksheets by picking the following: 1St group (tab) would include rows 1, 4, 7, 10, 13 etc. adding the 3rd row to the end. 2nd group (tab) would include rows 2, 5, 8, 11, 14, etc. adding the 3rd row to the end 3rd group (tab) would include rows 3, 6, 9, 12, etc. adding the 3rd row to the end. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
add two cells from seperate work sheets into a cell on seperate wo | Excel Worksheet Functions | |||
Deleting groups of rows when using a macro recording? | Excel Discussion (Misc queries) | |||
Excel - Sorting groups in groups due to subtotaling | Excel Worksheet Functions | |||
Macro for sorting within groups | Excel Programming | |||
how do i view all groups under excel in google groups | Excel Discussion (Misc queries) |