I wrote a bit of code to compare the sums in three cells and if they are all zero I need to delete the column, but it's achingly slow; like one column every 3 seconds and there are over 5000 columns.
Is there a way to speed up the process?
Code:
Is there a way to speed up the process?
Code:
Code:
Sub Delete_Columns_with_no_demand_or_forecasts()
Dim iRow As Integer, iColumn As Integer, totalcols As Long
For iColumn = 5159 To 2 Step -1
If Cells(16, iColumn) + Cells(30, iColumn) + Cells(44, iColumn) = 0 Then
Columns(iColumn).EntireColumn.Delete
End If
Cells(1, 1) = iColumn
Next iColumn
End Sub