Copying macro
Closed
group123
Posts
4
Registration date
Tuesday April 12, 2016
Status
Member
Last seen
April 12, 2016
-
Apr 12, 2016 at 05:50 PM
group123 Posts 4 Registration date Tuesday April 12, 2016 Status Member Last seen April 12, 2016 - Apr 12, 2016 at 06:45 PM
group123 Posts 4 Registration date Tuesday April 12, 2016 Status Member Last seen April 12, 2016 - Apr 12, 2016 at 06:45 PM
I want to write a macro where it groups my data by group # and copy the data of each group # into different sheets.
Afterward, rename each sheets to the grouped name instead of "sheet1" or "sheet2".
The range of the source data is unknown but I can but a dummy group # to indicate the end of the group.
Currently I manually grouped the data source and copy each group # into different sheet. Than rename each sheet.
Thanks
Sam
Afterward, rename each sheets to the grouped name instead of "sheet1" or "sheet2".
The range of the source data is unknown but I can but a dummy group # to indicate the end of the group.
Currently I manually grouped the data source and copy each group # into different sheet. Than rename each sheet.
Thanks
Sam
Related:
- Copying macro
- Protect pdf from copying - Guide
- Spell number in excel without macro - Guide
- Excel macro download - Download - Spreadsheets
- Online macro excel - Guide
- Excel run macro on open - Guide
Apr 12, 2016 at 06:23 PM
grp# 123 in one tab and 358 on another tab.
grp # company name hire date
123 abb joe smith 1/1/2016
123 abb john stein 1/5/2016
358 asus jane quinn 2/5/2016
358 asus jack jones 4/1/2016
Apr 12, 2016 at 06:26 PM
Apr 12, 2016 at 06:29 PM
Apr 12, 2016 at 06:45 PM
Sub Macro6()
'
' Macro6 Macro
'
'
Cells.Select
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Sheet1").Sort.SortFields.Add Key:=Range("A2:A10") _
, SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Sheet1").Sort
.SetRange Range("A1:E10")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Rows("2:3").Select
Selection.Copy
Sheets.Add After:=ActiveSheet
ActiveSheet.Paste
Sheets("Sheet10").Select
Sheets("Sheet10").Name = "abb"
Sheets("Sheet1").Select
Range("B11").Select
Application.CutCopyMode = False
Rows("4:6").Select
Selection.Copy
Sheets.Add After:=ActiveSheet
ActiveSheet.Paste
Sheets("Sheet11").Select
Sheets("Sheet11").Name = "asus"
Range("E21").Select
Sheets("Sheet1").Select
Range("C14").Select
Application.CutCopyMode = False
End Sub