Hi all,
Novice coder here! I'm trying to create a macro that deletes specific columns - just by which one, not even by criteria like a cell value.
I'd like to be able to do this with an array where I specify the columns, but I don't know how to loop through each slot in the array to delete the column. If there's a better way to do this, I'd appreciate that, too!
I've gotten as far as declaring the array:
Dim coldelArray() As Variant
coldelArray = Array(3, 5, 8, 10, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26)
And the function to delete a column:
Columns(however I get the value from the array).EntireColumn.Delete
Thanks!
EB
Novice coder here! I'm trying to create a macro that deletes specific columns - just by which one, not even by criteria like a cell value.
I'd like to be able to do this with an array where I specify the columns, but I don't know how to loop through each slot in the array to delete the column. If there's a better way to do this, I'd appreciate that, too!
I've gotten as far as declaring the array:
Dim coldelArray() As Variant
coldelArray = Array(3, 5, 8, 10, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26)
And the function to delete a column:
Columns(however I get the value from the array).EntireColumn.Delete
Thanks!
EB