Results 1 to 4 of 4

Run-time error '1004': Delete method of Range class failed

Threaded View

  1. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Run-time error '1004': Delete method of Range class failed

    Hi,

    Personally I'd avoid a looping procedure to do this sort of stuff. Using a Data filter is the fastest way I know and far more efficient than a loop.

    So set up a horizontal criteria list with your consultant names and name this range say "crit". Put ="<>John Smith" etc. in the second row of the criteria. Name the range you're trying to filter 'Data"

    Then something like

    Sub Delete
       Range("Data").AdvancedFilter Action:=xlFilterInPlace, criteriarange:=Range("crit")
       Range("Data").Offset(1,0).SpecialCells(xlCellTypeVisible).EntireRow.Delete
    End Sub
    Last edited by zbor; 07-17-2014 at 07:04 AM.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

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': Select method of Range Class failed VBA
    By jcgonzales in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-19-2014, 01:39 AM
  2. Replies: 1
    Last Post: 01-07-2014, 01:08 AM
  3. [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
  4. [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
  5. Run-time error '1004' - Select method of Range class failed
    By g10drac in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-08-2011, 08:03 PM

Tags for this Thread

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