Sub DelCols()
Dim Usdcols As Long
Usdcols = Cells(1, Columns.Count).End(xlToLeft).Column
If Usdcols > 5 Then
Range("F1", Cells(1, Usdcols - 1)).EntireColumn.Delete
End If
End Sub
hi & welcome to the board.
How aboutCode:sub delcols() dim usdcols as long usdcols = cells(1, columns.count).end(xltoleft).column if usdcols > 5 then range("f1", cells(1, usdcols - 1)).entirecolumn.delete end if end sub