ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete columns (https://www.excelbanter.com/excel-programming/280897-delete-columns.html)

David

Delete columns
 
TIA for any help
I have a one dimension array populated with integers (i)
which correspond to column index numbers where each column
requires deleting. The low values in the array are for
columns on sheets(1), The higher values are on sheets(2)
and above. The rule is:
Sheets(n) = Sheets(Worksheetfunction.Roundup(MyArray
(i)/200))
I can loop through the array and get sheets(number) and
columns (number). However, if I delete a column at each
step then the original column number relationship is lost
after step one. I think I need to assemble the aray
elements into a non contiguous range object, one for each
sheet, and then delete all columns at once. The trouble is
the text string will be to long for a text range argument.
There must be another way ... any ideas?
David

Tom Ogilvy

Delete columns
 
delete columns from right to left

--
Regards,
Tom Ogilvy

"David" wrote in message
...
TIA for any help
I have a one dimension array populated with integers (i)
which correspond to column index numbers where each column
requires deleting. The low values in the array are for
columns on sheets(1), The higher values are on sheets(2)
and above. The rule is:
Sheets(n) = Sheets(Worksheetfunction.Roundup(MyArray
(i)/200))
I can loop through the array and get sheets(number) and
columns (number). However, if I delete a column at each
step then the original column number relationship is lost
after step one. I think I need to assemble the aray
elements into a non contiguous range object, one for each
sheet, and then delete all columns at once. The trouble is
the text string will be to long for a text range argument.
There must be another way ... any ideas?
David





All times are GMT +1. The time now is 10:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com