ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Can't delete columns in Excel VBA (https://www.excelbanter.com/excel-programming/361667-cant-delete-columns-excel-vba.html)

BillReese

Can't delete columns in Excel VBA
 
I am automating Excel from a VB application.

I attempted to insert a column way down in my code (after populating the
sheet with many columns from data from many files (maybe 32, maybe 48, or 64
columns of ASCII Data).

My code bombed when I attempted the insert of a new column saying it can't
shift cells off the edge of the worksheet. After I failed at that: I
attempted to delete all empty columns to the right of my used area, and my
code also bombs, don't remember that error message right now.

can someone tell me what I need to do in order to either insert new columns,
so that any data will shift off the edge of the sheet, or how I can get my
empty columns deleted. ( I don't need code to find last used column, I
already have that)

Thanks BillReese



Norman Jones

Can't delete columns in Excel VBA
 
Hi Bill,

See MSKB Article # 211769:
"Cannot shift objects off sheet" error message when
you hide columns in Excel "

http://support.microsoft.com/default...b;en-us;211769


---
Regards,
Norman



"BillReese" wrote in message
news:5Vvag.3889$343.2375@trnddc06...
I am automating Excel from a VB application.

I attempted to insert a column way down in my code (after populating the
sheet with many columns from data from many files (maybe 32, maybe 48, or
64 columns of ASCII Data).

My code bombed when I attempted the insert of a new column saying it
can't shift cells off the edge of the worksheet. After I failed at that:
I attempted to delete all empty columns to the right of my used area, and
my code also bombs, don't remember that error message right now.

can someone tell me what I need to do in order to either insert new
columns, so that any data will shift off the edge of the sheet, or how I
can get my empty columns deleted. ( I don't need code to find last used
column, I already have that)

Thanks BillReese





All times are GMT +1. The time now is 07:27 PM.

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