I have a macro that deletes the sales information at the end of the month so I can create a new sheet for the next month.
It works, and it works fine, it's just slow. I already turn off automatic calculation, and that helps to speed it up.
I do have a large number of formulas with nested ifs and vlookups pulling information that i need to process the commissions, so that may be what is causing it, and there is no other easier way.
At the very bottom of the data, i have the word "Finished" to signify the completion, since the number of total lines changes each month, and there is other necessary information below the totals that i don't want deleted. It's the only way I easily knew to make it stop.
Sub Delete_Sales_Information()
Sheets("Sales Consolidated").Select
ActiveSheet.Range("C2").Select
Application.Calculation = xlManual
Beginning:
If IsEmpty(ActiveCell) Then
Selection.Offset(1, 0).Select
GoTo Beginning
End If
If ActiveCell = "Finished" Then GoTo Finish
Rows(ActiveCell.Row).EntireRow.Delete
GoTo Beginning
Finish:
Application.Calculation = xlAutomatic
End Sub
It may be that nothing can be improved, and that's fine, but i thought I'd ask. I'm not exactly an expert in this arena.
Thanks for the help.
Bookmarks