Sub Delete()
Dim Col As Long
Application.ScreenUpdating = False
With Sheets("Archives")
For Col = 30 To 3 Step -1
If .Cells(2, Col).Value < Date - 365 Then
.Cells(1, Col).EntireColumn.Delete
End If
Next
End With
Application.ScreenUpdating = True
End Sub
Sub AddDate()
Dim Firstday As Long
Dim LastDay As Long
Dim I As Long
Dim Dte As Long
Application.ScreenUpdating = False
With Sheets("Archives")
LastDate = .Cells(2, .Columns.Count).End(xlToLeft).Value
Firstday = LastDate + 1
LastDay = VBA.DateAdd("m", 6, LastDate)
For Dte = Firstday To LastDay
.Cells(2, .Columns.Count).End(xlToLeft).Offset(, 1) = CDate(Dte)
Next Dte
End With
Application.ScreenUpdating = True
End Sub