Hello,
I have a partial macro written (recorded). I am copying the last row of data from columns the A thru T on the "CURRENT" tab and pasting it to the last row on the "SUMMARY" tab. That part of my macro is working fine.
I now need to add some things and I have no clue how to do it.
After the data is pasted on the last row of "SUMMARY" tab, I need to:
1. Format the row to the same formatting that exists in the row above.
2. Paste the formulas from the row above to the row I just added. The columns I need to copy the formulas from are E, F, H, I, K, L, N, O and Q.
3. In column A of the row I just added, I need to add the current date.
Below is my marcro. Any help would be appreciated!
I have a partial macro written (recorded). I am copying the last row of data from columns the A thru T on the "CURRENT" tab and pasting it to the last row on the "SUMMARY" tab. That part of my macro is working fine.
I now need to add some things and I have no clue how to do it.
After the data is pasted on the last row of "SUMMARY" tab, I need to:
1. Format the row to the same formatting that exists in the row above.
2. Paste the formulas from the row above to the row I just added. The columns I need to copy the formulas from are E, F, H, I, K, L, N, O and Q.
3. In column A of the row I just added, I need to add the current date.
Below is my marcro. Any help would be appreciated!
Code:
Sub Sum()
' Sum Macro
Sheets("Current").Select
Columns("E:S").Select
Selection.EntireColumn.Hidden = False
ActiveWorkbook.Worksheets("Current").AutoFilter.Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Current").AutoFilter.Sort.SortFields.Add2 Key:= _
Range("A6"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Current").AutoFilter.Sort
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Sheets("Current").Select
With ActiveSheet
.Cells(.Rows.Count, 1).End(xlUp).EntireRow.Select
.Cells(.Rows.Count, 1).End(xlUp).EntireRow.Copy
End With
Dim lastrow As Long
lastrow = Sheets("Summary").Range("A65536").End(xlUp).Row
Sheets("Summary").Select
Cells(lastrow + 1, 1).PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks:=False, Transpose:=False
Sheets("Current").Select
Range("R:R,O:O,L:L").Select
Range("L1").Activate
ActiveWindow.SmallScroll ToRight:=-3
Range("R:R,O:O,L:L,I:I").Select
Range("I1").Activate
ActiveWindow.SmallScroll ToRight:=-2
Range("R:R,O:O,L:L,I:I,F:F").Select
Range("F1").Activate
Selection.EntireColumn.Hidden = True
Sheets("Summary").Select
End Sub
Last edited by a moderator: