+ Reply to Thread
Results 1 to 4 of 4

Macro to delete rows where cell value is zero

  1. #1
    Registered User
    Join Date
    04-16-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    29

    Macro to delete rows where cell value is zero

    Hi All,

    I apologise in advance for asking help on what looks like a very common question. I have scrolled through various solutions to this question and just don't seem to be able to get a very simple code which I would understand as a beginner to work. I think it has a lot to do with the fact I don't understand how to name a range, and the fact that I don't understand what most of the code means, and therefore have had some interesting results when I have copied code over.

    So here's the deal - I have a table in excel where column D has numeric values from 0 and greater and would like to delete the rows that contain 0. The data is refreshed each month, therefore the number of rows this table has will vary, so I can't just say D2:D200 for example.

    This is the latest code I tried. My computer has thought about it for ages and eventually just froze.

    Thanks

    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    08-07-2011
    Location
    Delhi
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Macro to delete rows where cell value is zero

    Hi,

    Try below code

    Please Login or Register  to view this content.
    Last edited by davesexcel; 04-16-2013 at 09:13 PM. Reason: Code tags required when supplying VBA code, please read the forum rules.

  3. #3
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,526

    Re: Macro to delete rows where cell value is zero

    This May be a simpler code
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    04-16-2013
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    29

    Re: Macro to delete rows where cell value is zero

    Thanks xlstime and davesexcel.

    Problem solved!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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