BigDelGooner
Board Regular
- Joined
- Aug 17, 2009
- Messages
- 197
I have the following for..loop that is missing out columns because when the Columns(c.Column).Delete is executed it automatically moves to the 'next c' and then when the code loops its passes another 'next c' command.
For Each c In Range(Cells(1, 3), Cells(1, Range("IV1").End(xlToLeft).Column))
If c.Value = 0 Then
Columns(c.Column).Delete
End If
Next c
How do I get round this? Is there a 'Previous c' kind of command that I could put in after the Columns(c.Column).Delete command?
For Each c In Range(Cells(1, 3), Cells(1, Range("IV1").End(xlToLeft).Column))
If c.Value = 0 Then
Columns(c.Column).Delete
End If
Next c
How do I get round this? Is there a 'Previous c' kind of command that I could put in after the Columns(c.Column).Delete command?