+ Reply to Thread
Results 1 to 2 of 2

Excell cannot complete error then Run-time error 1004 delete method of range class failed

  1. #1
    Registered User
    Join Date
    05-13-2014
    MS-Off Ver
    Excel 2003
    Posts
    20

    Excell cannot complete error then Run-time error 1004 delete method of range class failed

    I am using a macro that creates a copy of a specific tab, then on the new tab it deletes rows that have nothing in a specific range of cells.

    When I run the macro today, I first get the excel error Excel cannot complete this task with available resources... when I select OK I get the macro error Run-time error '1004': Delete method of range class failed. I have been using this macro for a while with no problems and have not made any changes to the macro.

    here is the macro:

    Please Login or Register  to view this content.
    The macro works fine at the beginning but when it gets to "Set rng = Range("h2:h" & LastRow)" and starts looping thru the rng it errors out when it gets to the first row with "". When I debug the line that it stops on is "rng.Cells(i).EntireRow.Delete".

    What is the problem? Any and all help is great.

  2. #2
    Valued Forum Contributor
    Join Date
    12-02-2009
    Location
    Austin, Tx
    MS-Off Ver
    Office 365 64-Bit, 2108, build 14326.21018
    Posts
    3,952

    Re: Excell cannot complete error then Run-time error 1004 delete method of range class fai

    You set the value for LastRow on the Journal Import sheet, but when you copy that sheet you're now on the new activesheet. I've taken a stab at cleaning up your code; see if this works any better for you.
    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Run-time error '1004': Delete method of Range class failed
    By Nobo1234 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-14-2016, 03:01 AM
  2. Run-time error '1004': Delete method of Range class failed
    By Lozza1234 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-17-2014, 04:56 PM
  3. Replies: 4
    Last Post: 11-15-2013, 05:03 PM
  4. VBA Code...error = run time error 1004 autofilter method of range class failed
    By Dariusd7 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 11-15-2013, 04:49 PM
  5. Run-Time Error '1004' AutoFill method of Range class Failed
    By RS944 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-15-2013, 11:37 AM
  6. [SOLVED] Run-time error '1004' ; Delete method of Range Class failed
    By Adam1987 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-14-2012, 06:43 AM
  7. [SOLVED] Delete method of range class failed - run time error 1004
    By plasma33 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-28-2012, 07:37 AM

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 Engine Friendly URLs by vBSEO 3.6.0 RC 1