I’m trying to write a bit of VBA which will check the value of a cell in a range of columns (rows M to GD), if the cell does not contain “YY” delete the column.
The cell to check is always in row 22
I’ve tried the following, but it’s seriously slow.
w = 186
Do
If Worksheets(“SOF”).Cells(22, w).Formula = "YY" Then
w = w - 1
Else
Worksheets(“SOF”).Cells(22, w).EntireColumn.Delete
End If
w = w - 1
Loop Until w < 13
Does anyone have any suggestions on how to speed this up or a better way to do this problem?
Thanks