Results 1 to 6 of 6

Thread: Excel guru please: Error cannot shift nonblank cells

  1. #1
    Join Date
    Feb 2007
    Location
    Brisbane
    Posts
    4,497
    Total Downloaded
    0

    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?

  2. #2
    Join Date
    Sep 2008
    Location
    Perth
    Posts
    511
    Total Downloaded
    0
    Whats the code?

    Dorko

  3. #3
    Join Date
    Feb 2007
    Location
    Brisbane
    Posts
    4,497
    Total Downloaded
    0
    Quote Originally Posted by Dorko View Post
    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.

  4. #4
    Join Date
    Sep 2008
    Location
    Perth
    Posts
    511
    Total Downloaded
    0
    Sent

    Dorko

  5. #5
    Join Date
    Feb 2007
    Location
    Brisbane
    Posts
    4,497
    Total Downloaded
    0
    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.

  6. #6
    Join Date
    Sep 2008
    Location
    Perth
    Posts
    511
    Total Downloaded
    0
    You have to love the work arounds.... i spend hours on some things, just trying to seek a better solution. Painful!

    Dorko

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search AULRO.com ONLY!
Search All the Web!