Dalacarelia
New Member
- Joined
- Apr 12, 2012
- Messages
- 7
Hello
My Macro problem to solve is like this
I have a One Sheet with name "
list 4 colums wide
Col1 (A) Defines name "PeterE" up to 50 names
Col2 (B) ( DefineType) GG or YRK
I have 2 TemplateSheet "GGTemplate and YRKTemplate and i need excel to make copy of the sheet for the right Type .
If its magic i will have 4 new sheets from 2 different templates and the nametable are sorted i alfabetic order colum A
My in my file i have 4 sheets with other information too so the new sheets need tobe added last
I have a solution for 1 Sheet but not with combo
Macro i need to fix
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif] [FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Sub Mixa_ihopGG()
'
Columns("A:C").Select
ActiveWorkbook.Worksheets("
ActiveWorkbook.Worksheets("
:=Range("A1:A100"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("A2").Select
Dim sh1 As Worksheet, sh2 As Worksheet, c As Range
Set sh1 = Sheets("
Set sh2 = Sheets("Input_Sheet")
For Each c In sh2.Range("A2", sh2.Cells(Rows.Count, 1).End(xlUp))
sh1.Copy After:=Sheets(Sheets.Count)
ActiveSheet.Name = c.Value
Next[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif][/FONT]
[/FONT][FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]
[/FONT]
My Macro problem to solve is like this
I have a One Sheet with name "
Input_Sheet "
list 4 colums wide
Col1 (A) Defines name "PeterE" up to 50 names
Col2 (B) ( DefineType) GG or YRK
I have 2 TemplateSheet "GGTemplate and YRKTemplate and i need excel to make copy of the sheet for the right Type .
If its magic i will have 4 new sheets from 2 different templates and the nametable are sorted i alfabetic order colum A
My in my file i have 4 sheets with other information too so the new sheets need tobe added last
<strike>
</strike>
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Colum A ( After macro runs alfabetic order ) [/TD]
[TD]Colum B[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]<strike></strike><strike></strike>Type
[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]GG[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]YRK[/TD]
[/TR]
[TR]
[TD]
[/TD]
[TD]GG[/TD]
[/TR]
[TR]
[TD]
[TD]YRK[/TD]
[/TR]
</tbody>[/TABLE]
</strike>
[TABLE="class: grid, width: 500, align: left"]
<tbody>[TR]
[TD]Colum A ( After macro runs alfabetic order ) [/TD]
[TD]Colum B[/TD]
[/TR]
[TR]
[TD]
Name
<strike></strike>[/TD]
[TD]<strike></strike><strike></strike>Type
[/TD]
[/TR]
[TR]
[TD]
PeterZ
<strike></strike>[/TD]
[TD]GG[/TD]
[/TR]
[TR]
[TD]
PeterK
<strike></strike>[/TD]
[TD]YRK[/TD]
[/TR]
[TR]
[TD]
PeterM
<strike></strike>[/TD]
[TD]GG[/TD]
[/TR]
[TR]
[TD]
PeterE
[/TD][TD]YRK[/TD]
[/TR]
</tbody>[/TABLE]
Macro i need to fix
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif] [FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]Sub Mixa_ihopGG()
'
Columns("A:C").Select
ActiveWorkbook.Worksheets("
Input_Sheet
).AutoFilter.Sort.SortFields.ClearActiveWorkbook.Worksheets("
Input_Sheet
").AutoFilter.Sort.SortFields.Add2 Key _:=Range("A1:A100"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("
Input_Sheet
").AutoFilter.Sort.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("A2").Select
Dim sh1 As Worksheet, sh2 As Worksheet, c As Range
Set sh1 = Sheets("
GGTemplate
")Set sh2 = Sheets("Input_Sheet")
For Each c In sh2.Range("A2", sh2.Cells(Rows.Count, 1).End(xlUp))
sh1.Copy After:=Sheets(Sheets.Count)
ActiveSheet.Name = c.Value
Next[/FONT]
[FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif][/FONT]
[/FONT][FONT=Verdana,Arial,Tahoma,Calibri,Geneva,sans-serif]
[/FONT]