Sub test()
Dim LastRow As Long
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
Sheet1.Activate
'Clear cells AL6 to AN & lastrow
LastRow = Range("AL" & Rows.Count).End(xlUp).Row
Range(Cells(6, 38), Cells(LastRow, 40)).ClearContents
'Clear cells AO6 to AQ & lastrow
LastRow = Range("AO" & Rows.Count).End(xlUp).Row
Range(Cells(6, 41), Cells(LastRow, 43)).ClearContents
'Determine last row of each column, copy, then paste column contents into column AL (#38)
'and column AO (#41) for all accounts
Range("A6").Select
Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
Loop
LastRow = ActiveCell.Row - 1
Range(Cells(6, 1), Cells(LastRow, 3)).Copy
Cells(Rows.Count, 38).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
Range("G6").Select
Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
Loop
LastRow = ActiveCell.Row - 1
Range(Cells(6, 7), Cells(LastRow, 9)).Copy
Cells(Rows.Count, 38).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
Range("M6").Select
Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
Loop
LastRow = ActiveCell.Row - 1
Range(Cells(6, 13), Cells(LastRow, 15)).Copy
Cells(Rows.Count, 38).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
Range("S6").Select
Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
Loop
LastRow = ActiveCell.Row - 1
Range(Cells(6, 19), Cells(LastRow, 21)).Copy
Cells(Rows.Count, 38).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
Range("Y6").Select
Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
Loop
LastRow = ActiveCell.Row - 1
Range(Cells(6, 25), Cells(LastRow, 27)).Copy
Cells(Rows.Count, 38).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
Range("AE6").Select
Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
Loop
LastRow = ActiveCell.Row - 1
Range(Cells(6, 31), Cells(LastRow, 33)).Copy
Cells(Rows.Count, 38).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
Range("D6").Select
Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
Loop
LastRow = ActiveCell.Row - 1
Range(Cells(6, 4), Cells(LastRow, 6)).Copy
Cells(Rows.Count, 41).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
Range("J6").Select
Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
Loop
LastRow = ActiveCell.Row - 1
Range(Cells(6, 10), Cells(LastRow, 12)).Copy
Cells(Rows.Count, 41).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
Range("P6").Select
Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
Loop
LastRow = ActiveCell.Row - 1
Range(Cells(6, 16), Cells(LastRow, 18)).Copy
Cells(Rows.Count, 41).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
Range("V6").Select
Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
Loop
LastRow = ActiveCell.Row - 1
Range(Cells(6, 22), Cells(LastRow, 24)).Copy
Cells(Rows.Count, 41).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
Range("AB6").Select
Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
Loop
LastRow = ActiveCell.Row - 1
Range(Cells(6, 28), Cells(LastRow, 30)).Copy
Cells(Rows.Count, 41).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
Range("AH6").Select
Do Until ActiveCell.Value = ""
ActiveCell.Offset(1, 0).Select
Loop
LastRow = ActiveCell.Row - 1
Range(Cells(6, 34), Cells(LastRow, 36)).Copy
Cells(Rows.Count, 41).End(xlUp).Offset(1).PasteSpecial Paste:=xlPasteValues
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
Bookmarks