gazingdown
Board Regular
- Joined
- May 21, 2003
- Messages
- 109
Should be simple but my brain isn't working these days
Anyway, I need to loop through row 1 in each column in a sheet and once the value is met (e.g. when D1 or H1 or AB1 etc. > 340) then delete all columns from that column onwards. The loop can then stop of course. I'm tryint to avoid the use of 'select' to make the code run more efficiently.
So far..basically the commented lines I can't figure out.
For Each CellCheck In wsBudget.Range("C1:IV1")
If CellCheck.Value > 340 Then
'delete all columns from here onwards
'then exit the CellCheck loop only
Next CellCheck
Anyway, I need to loop through row 1 in each column in a sheet and once the value is met (e.g. when D1 or H1 or AB1 etc. > 340) then delete all columns from that column onwards. The loop can then stop of course. I'm tryint to avoid the use of 'select' to make the code run more efficiently.
So far..basically the commented lines I can't figure out.
For Each CellCheck In wsBudget.Range("C1:IV1")
If CellCheck.Value > 340 Then
'delete all columns from here onwards
'then exit the CellCheck loop only
Next CellCheck