-
How to add a column to a collection
Hi
Hello
I need to delete columns that doesn't contain data, and in order to do that. I believe I first have to create a collection og those columns that doesn't contain data. This is what I've come up with so far but unfortunately it doesn't work:
[vba]
dim s as collection
For i = 1 To r
If WorksheetFunction.Sum(Range(Cells(2, i + 1), Cells(p + 1, i + 1))) = 0 Then
s.Add (Columns(i + 1))
End If
Next i
For Each comlumns In s
Columns.Delete Shift:=xlToLeft
Next[/vba]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules