Maybe go from last column to the first column.
Not tested.
![]()
Sub Deleteolddata() Dim ws As Worksheet Dim LongCol As Long Set ws = ActiveWorkbook.Sheets("Graph") LongCol = ws.Cells(1, Columns.Count).End(xlToLeft).Column For x = LongCol To 1 Step -1 If ws.Cells(1, x) <= Date - 3 Then ws.Columns(x).Delete End If Next x End Sub
Bookmarks