WhiteD3
19th May 2010, 12:25 PM
I have a multi-tab 2007 workbook where the user can, via a button and VBA code, add and delete columns in one tab, at which time the matching column(s) in another tab are added or deleted.
If I delete a column, then immediately add a column, Excel gives me a runtime error 1004 "cannot shift non blank cells off the worksheet".
If I just add columns there's no error.
If I add then save, close, re-open, then delete, there's no error.
Following the code execution, the error occurs when the code adds the column to the second tab. Looking at the column formatting on the RHS of the sheet, some formating (borders) appear in some cells in the far RH column each time I delete a column.
I have checked the code and at no time reference this end column.
Makes no sense to me at all. Any ideas please?
If I delete a column, then immediately add a column, Excel gives me a runtime error 1004 "cannot shift non blank cells off the worksheet".
If I just add columns there's no error.
If I add then save, close, re-open, then delete, there's no error.
Following the code execution, the error occurs when the code adds the column to the second tab. Looking at the column formatting on the RHS of the sheet, some formating (borders) appear in some cells in the far RH column each time I delete a column.
I have checked the code and at no time reference this end column.
Makes no sense to me at all. Any ideas please?