My original macro included below still works but it doesn't delete any of the date columns. It seems to just skip over your code.
An alternate way of writing the code would be to delete columns K:lastcolumn except for the last 12 columns. I am unsure how to do this because each day 1 more column is automatically added for the current date.
Code:
Sub RDU_2()
Application.ScreenUpdating = False
Dim TDate As Date
Range("A1").Select
ActiveCell.FormulaR1C1 = "JO/KO"
Range("B1").Select
ActiveCell.FormulaR1C1 = "TITLE"
Range("E:E,G:J,L:L,N:O,Q:T,W:AA").Select
Selection.EntireColumn.Delete
Do Until Range("K1").Value > TDate - 10
Range("K1").Columns.Delete
Loop
Columns("A:A").Select
Selection.ColumnWidth = 15
Columns("B:B").Select
Selection.ColumnWidth = 48
Columns("B:B").EntireColumn.AutoFit
Columns("C:D").Select
Selection.ColumnWidth = 19.29
Columns("E:F").Select
Selection.ColumnWidth = 9.29
Columns("G:G").Select
Selection.ColumnWidth = 3.57
Columns("H:J").Select
Selection.ColumnWidth = 5
Columns("K:T").Select
Selection.ColumnWidth = 2.86
Application.ScreenUpdating = True
End Sub
This must be placed in the worksheet module and will activate as soon as you activate the sheet. This code assumes your dates start in K1 and continue to the right. If your dates start in a different cell replace K1 with that cell address. Try this code, you can assign it to a button or press F5 to run it (while you are in the code window):
Code:
Sub newCode()
Application.ScreenUpdating = False
Dim TDate As Date
Do Until Range("K1").Value > TDate - 10
Range("K1").Columns.Delete
Loop
Application.ScreenUpdating = True
End Sub