I am having difficulty creating this Macro:
Purpose: Using a report that is generated each month, pull information from main sheet and copy onto new sheet, format the sheet and sum relevant numbers.
Complete Process:
1) Create 3 new sheet with static names, and copy header information to each sheet. (Sheet X, Y & Z)
2) Search Column D to find 13, then copy that entire row and paste onto Sheet X, after the header information
3) Search Column B to find Value Y, then copy that entire row and paste onto Sheet Y, after header information. Repeat until all Value Y has been copied.
4) Search Column B to find Value Z, then copy that entire row and paste onto Sheet Z, after header information. Repeat until all Value Z has been copied
5) Select Sheet X. Delete Columns F, G, H, J, K, L, N, O. Select G2, give double-lined Bottom Border. Then sum G in next empty cell.
6) Select Sheet Y. Delete Columns F, G, H, J, K, L, N, O. Select G9, give double-lined Bottom Border. Then sum G in next empty cell.
7) Select Sheet Z. Delete Columns G, H, I, J, K, L, M, O. Select G10, give double-lined Bottom Border. Then sum G in next empty cell.
Please note that X, Y & Z values are static and will not change.
I really only need assistance with steps 2 - 4, but I have found that if you know the end goal, then it is easier to solve the issue.
Here is some of my code for the other steps
Purpose: Using a report that is generated each month, pull information from main sheet and copy onto new sheet, format the sheet and sum relevant numbers.
Complete Process:
1) Create 3 new sheet with static names, and copy header information to each sheet. (Sheet X, Y & Z)
2) Search Column D to find 13, then copy that entire row and paste onto Sheet X, after the header information
3) Search Column B to find Value Y, then copy that entire row and paste onto Sheet Y, after header information. Repeat until all Value Y has been copied.
4) Search Column B to find Value Z, then copy that entire row and paste onto Sheet Z, after header information. Repeat until all Value Z has been copied
5) Select Sheet X. Delete Columns F, G, H, J, K, L, N, O. Select G2, give double-lined Bottom Border. Then sum G in next empty cell.
6) Select Sheet Y. Delete Columns F, G, H, J, K, L, N, O. Select G9, give double-lined Bottom Border. Then sum G in next empty cell.
7) Select Sheet Z. Delete Columns G, H, I, J, K, L, M, O. Select G10, give double-lined Bottom Border. Then sum G in next empty cell.
Please note that X, Y & Z values are static and will not change.
I really only need assistance with steps 2 - 4, but I have found that if you know the end goal, then it is easier to solve the issue.
Here is some of my code for the other steps
Code:
Sheets.Add After:=ActiveSheet
Sheets("Sheet2").Select
Sheets("Sheet2").Name = "X"
Sheets.Add After:=ActiveSheet
Sheets("Sheet3").Select
Sheets("Sheet3").Name = "Y"
Sheets.Add After:=ActiveSheet
Sheets("Sheet4").Select
Sheets("Sheet4").Name = "Z"
Rows("2:2").Select
Selection.Copy
Sheets("X").Select
ActiveSheet.Paste
Application.CutCopyMode = False
With Selection
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlLTR
.MergeCells = False
End With
Cells.Select
Cells.EntireColumn.AutoFit
Sheets("Y").Select
ActiveSheet.Paste
Application.CutCopyMode = False
With Selection
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlLTR
.MergeCells = False
End With
Cells.Select
Cells.EntireColumn.AutoFit
Sheets("Z").Select
ActiveSheet.Paste
Application.CutCopyMode = False
With Selection
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlLTR
.MergeCells = False
End With
Cells.Select
Cells.EntireColumn.AutoFit