-
19th May 2010, 12:25 PM
#1
Excel guru please: Error cannot shift nonblank cells
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?
-
19th May 2010, 03:41 PM
#2
-
19th May 2010, 04:53 PM
#3

Originally Posted by
Dorko
Whats the code?
Dorko
Dorko, PM me your email address and I'll send you the file if you like. Tried to PM you but you're blocking PMs.
-
19th May 2010, 04:55 PM
#4
-
22nd May 2010, 09:12 AM
#5
Dorko,
In the end I had to add some code as discussed to clear the formating in that last column. All works well now although the anal retentive in me hates having to do work arounds.
Thanks for your time and help.
-
22nd May 2010, 08:04 PM
#6
You have to love the work arounds.... i spend hours on some things, just trying to seek a better solution. Painful!
Dorko
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
Search AULRO.com ONLY!
|
Search All the Web!
|
Bookmarks