Excel table breakdown to separate sheets?
up vote
0
down vote
favorite
I have a big dataset that looks like this:
The number of cols for each State is the same (Revenue, cost, and margin). The data set has a lot of other State to the right, let's say AZ, CO, CA, etc (the real dataset has more than 100 cities)
Now what I want to do is to break these huge pivoted dataset into separate tables in separate sheets in the same workbook as the original dataset (201701 for this example). They look like these 3 tables with the black header:
The 3 cols (revenue, cost, and margin) are the same for each table, while there are more programs than shown.
I have more files like these, so there will be 201702.xlsm, 201703.xlsm, etc.
Anyone can help me with this problem? Here's the code that I built using macro (needless to say, it doesn't work the way I want it to be).
Sub BreakdownTables()
'
' BreakdownTables Macro
'
'
Range("B1:D7").Select
Sheets.Add After:=ActiveSheet
Sheets("Trial").Select
'I basically just copy-paste the tables to separate sheets
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste
Sheets("Trial").Select
Range("E1:G7").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Sheets.Add After:=ActiveSheet
Sheets("Sheet3").Select
ActiveSheet.Paste
Sheets("Trial").Select
Range("H1:J7").Select
Application.CutCopyMode = False
Selection.Copy
Sheets.Add After:=ActiveSheet
ActiveSheet.Paste
Sheets("Sheet4").Select
Application.CutCopyMode = False
Sheets("Sheet4").Move After:=Sheets(9)
Range("F19").Select
Sheets("Sheet2").Select
'Trying to automatically rename the sheets
Sheets("Sheet2").Name = "="
Range("E13").Select
Sheets("=A1").Select
End Sub
I am at my wits end here and will gratefully appreciate any help or suggestion.
Thanks so much!
excel vba excel-vba
add a comment |
up vote
0
down vote
favorite
I have a big dataset that looks like this:
The number of cols for each State is the same (Revenue, cost, and margin). The data set has a lot of other State to the right, let's say AZ, CO, CA, etc (the real dataset has more than 100 cities)
Now what I want to do is to break these huge pivoted dataset into separate tables in separate sheets in the same workbook as the original dataset (201701 for this example). They look like these 3 tables with the black header:
The 3 cols (revenue, cost, and margin) are the same for each table, while there are more programs than shown.
I have more files like these, so there will be 201702.xlsm, 201703.xlsm, etc.
Anyone can help me with this problem? Here's the code that I built using macro (needless to say, it doesn't work the way I want it to be).
Sub BreakdownTables()
'
' BreakdownTables Macro
'
'
Range("B1:D7").Select
Sheets.Add After:=ActiveSheet
Sheets("Trial").Select
'I basically just copy-paste the tables to separate sheets
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste
Sheets("Trial").Select
Range("E1:G7").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Sheets.Add After:=ActiveSheet
Sheets("Sheet3").Select
ActiveSheet.Paste
Sheets("Trial").Select
Range("H1:J7").Select
Application.CutCopyMode = False
Selection.Copy
Sheets.Add After:=ActiveSheet
ActiveSheet.Paste
Sheets("Sheet4").Select
Application.CutCopyMode = False
Sheets("Sheet4").Move After:=Sheets(9)
Range("F19").Select
Sheets("Sheet2").Select
'Trying to automatically rename the sheets
Sheets("Sheet2").Name = "="
Range("E13").Select
Sheets("=A1").Select
End Sub
I am at my wits end here and will gratefully appreciate any help or suggestion.
Thanks so much!
excel vba excel-vba
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a big dataset that looks like this:
The number of cols for each State is the same (Revenue, cost, and margin). The data set has a lot of other State to the right, let's say AZ, CO, CA, etc (the real dataset has more than 100 cities)
Now what I want to do is to break these huge pivoted dataset into separate tables in separate sheets in the same workbook as the original dataset (201701 for this example). They look like these 3 tables with the black header:
The 3 cols (revenue, cost, and margin) are the same for each table, while there are more programs than shown.
I have more files like these, so there will be 201702.xlsm, 201703.xlsm, etc.
Anyone can help me with this problem? Here's the code that I built using macro (needless to say, it doesn't work the way I want it to be).
Sub BreakdownTables()
'
' BreakdownTables Macro
'
'
Range("B1:D7").Select
Sheets.Add After:=ActiveSheet
Sheets("Trial").Select
'I basically just copy-paste the tables to separate sheets
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste
Sheets("Trial").Select
Range("E1:G7").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Sheets.Add After:=ActiveSheet
Sheets("Sheet3").Select
ActiveSheet.Paste
Sheets("Trial").Select
Range("H1:J7").Select
Application.CutCopyMode = False
Selection.Copy
Sheets.Add After:=ActiveSheet
ActiveSheet.Paste
Sheets("Sheet4").Select
Application.CutCopyMode = False
Sheets("Sheet4").Move After:=Sheets(9)
Range("F19").Select
Sheets("Sheet2").Select
'Trying to automatically rename the sheets
Sheets("Sheet2").Name = "="
Range("E13").Select
Sheets("=A1").Select
End Sub
I am at my wits end here and will gratefully appreciate any help or suggestion.
Thanks so much!
excel vba excel-vba
I have a big dataset that looks like this:
The number of cols for each State is the same (Revenue, cost, and margin). The data set has a lot of other State to the right, let's say AZ, CO, CA, etc (the real dataset has more than 100 cities)
Now what I want to do is to break these huge pivoted dataset into separate tables in separate sheets in the same workbook as the original dataset (201701 for this example). They look like these 3 tables with the black header:
The 3 cols (revenue, cost, and margin) are the same for each table, while there are more programs than shown.
I have more files like these, so there will be 201702.xlsm, 201703.xlsm, etc.
Anyone can help me with this problem? Here's the code that I built using macro (needless to say, it doesn't work the way I want it to be).
Sub BreakdownTables()
'
' BreakdownTables Macro
'
'
Range("B1:D7").Select
Sheets.Add After:=ActiveSheet
Sheets("Trial").Select
'I basically just copy-paste the tables to separate sheets
Selection.Copy
Sheets("Sheet2").Select
ActiveSheet.Paste
Sheets("Trial").Select
Range("E1:G7").Select
Application.CutCopyMode = False
Selection.Copy
Sheets("Sheet2").Select
Sheets.Add After:=ActiveSheet
Sheets("Sheet3").Select
ActiveSheet.Paste
Sheets("Trial").Select
Range("H1:J7").Select
Application.CutCopyMode = False
Selection.Copy
Sheets.Add After:=ActiveSheet
ActiveSheet.Paste
Sheets("Sheet4").Select
Application.CutCopyMode = False
Sheets("Sheet4").Move After:=Sheets(9)
Range("F19").Select
Sheets("Sheet2").Select
'Trying to automatically rename the sheets
Sheets("Sheet2").Name = "="
Range("E13").Select
Sheets("=A1").Select
End Sub
I am at my wits end here and will gratefully appreciate any help or suggestion.
Thanks so much!
excel vba excel-vba
excel vba excel-vba
asked 20 hours ago
user71812
916
916
add a comment |
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53203225%2fexcel-table-breakdown-to-separate-sheets%23new-answer', 'question_page');
}
);
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password