+ Reply to Thread
Results 1 to 9 of 9

Remove zeros from sheet

  1. #1
    Registered User
    Join Date
    06-20-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    91

    Remove zeros from sheet

    Hi...I have a worksheet which is based on calculations from another worksheet. In effect it is copying data from one sheet to another.
    The issue I have is that after the calculations the worksheet pulls through lines that have zero amounts (I have a debit and credit amount columns - Columns I and J). I would like to remove the lines that have zero amounts in both columns I and J.
    Can anyone please help me with this? Thanks
    Last edited by fusion007; 07-04-2011 at 05:38 AM. Reason: More information

  2. #2
    Forum Expert
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2019
    Posts
    4,168

    Re: Remove zeros from sheet

    hi, fusion007, can you post sample workbook showing original data and the result you need to obtain?

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Remove zeros from sheet

    Please Login or Register  to view this content.



  4. #4
    Registered User
    Join Date
    06-20-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: Remove zeros from sheet

    Quote Originally Posted by snb View Post
    Please Login or Register  to view this content.
    snb thanks very much for the code but this just removes the zero values and leaves the lines in. I want to remove the whole lines that have 0.00 in the debit and credit columns (columns I and J).
    Thanks

  5. #5
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Remove zeros from sheet

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    06-20-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: Remove zeros from sheet

    Thanks snb. i will need to enter the code in between another code so what do I need to replace the sub snb() with. Mt last part of the code is to save the workbook and I will enter this code to remove the zero lines before this.
    Thanks

  7. #7
    Registered User
    Join Date
    06-20-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: Remove zeros from sheet

    Hi snb...I used this code

    Please Login or Register  to view this content.
    and it deletes all rows after the first row with the zeros irrespective of whether there are values in columns I and J. Please help!

  8. #8
    Registered User
    Join Date
    06-20-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: Remove zeros from sheet

    Hi please find attached sample workbook. In this example I want to remove rows 2 and 5 from the worksheet as the amounts in columns I and J are 0.00
    Thanks
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    06-20-2011
    Location
    England
    MS-Off Ver
    Excel 2003
    Posts
    91

    Re: Remove zeros from sheet

    Hi snb...your code will delete all rows that has a 0 in column 9 which is why I've noticed that everything has been deleted when I ran the code.
    I only want to delete rows where both columns 9 and 10 have a zero in them.
    Thanks

+ 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