+ Reply to Thread
Results 1 to 6 of 6

Macro to delete rows in Col B where the values are zero

  1. #1
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Macro to delete rows in Col B where the values are zero

    I have written code to delete rows containing zeroes in Col B from sheet 6 onwards (row 2 onwards)


    When running the macro, it goes into a loop and I need to shut down Excel


    It would be appreciated if someone could kindly assist me in resolving this





    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: Macro to delete rows in Col B where the values are zero

    Well,
    The code loops through many sheets and then loops again in column B for each sheet. When it deletes the row, it selects the entire row.
    I suggest, you should use a filter which is much faster, or you could put in all the rows to be deleted in a range as a collection and do a single delete.

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Macro to delete rows in Col B where the values are zero

    Try this on a copy of your workbook...

    Please Login or Register  to view this content.
    HTH
    Regards, Jeff

  4. #4
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Macro to delete rows in Col B where the values are zero

    Thanks for the help, Jeff. Code works perfectly

  5. #5
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Macro to delete rows in Col B where the values are zero

    Thanks for the advise

  6. #6
    Spammer
    Join Date
    08-20-2012
    Location
    Canada
    MS-Off Ver
    2007
    Posts
    221

    Re: Macro to delete rows in Col B where the values are zero


+ 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] change macro to delete values in rows
    By max_max in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 06-20-2015, 07:26 AM
  2. [SOLVED] Macro help : Need a macro to delete rows that do not contain values >1 in columns O or P
    By ostego in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-13-2014, 06:44 AM
  3. VB Macro - Sorty by column Delete rows containing Values
    By haleakala17 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-12-2014, 04:21 PM
  4. [SOLVED] Help with macro to delete rows based on values
    By jimstrongy in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-26-2012, 08:49 AM
  5. Macro to delete rows containing values
    By mohan_rajun in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 10-12-2010, 07:30 AM
  6. Macro needed to delete rows based on values
    By bensun in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-12-2010, 06:23 AM
  7. macro to delete rows with a range for values
    By poole in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 03-28-2009, 02:18 PM

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