+ Reply to Thread
Results 1 to 10 of 10

Deletion of rows where a value is satisfied

  1. #1
    Larry Wallis
    Guest

    Deletion of rows where a value is satisfied

    I have a spreadsheet with 3 colums. Columns are headed Part Number,
    Description and Qty.

    What I would like to do is delete all rows where the qty value is zero.

    I can't do this using auto filter as I have some small sub headings within
    the list and want them to stay visible.

    Any ideas please?

    Many thanks.

    Larry.

  2. #2
    Bob Phillips
    Guest

    Re: Deletion of rows where a value is satisfied

    Sub DeleteRows()
    Dim cLastRow As Long
    Dim i As Long

    cLastRow = Cells(Rows.Count,"A").End(xlUp).Row
    For i = cLastRow To 1 Step -1
    if Cells(i,"C").Value = 0 Then
    Cells(i,"C").EntireRow.Delete
    End If
    Next i
    End Sub

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Larry Wallis" <[email protected]> wrote in message
    news:[email protected]...
    > I have a spreadsheet with 3 colums. Columns are headed Part Number,
    > Description and Qty.
    >
    > What I would like to do is delete all rows where the qty value is zero.
    >
    > I can't do this using auto filter as I have some small sub headings within
    > the list and want them to stay visible.
    >
    > Any ideas please?
    >
    > Many thanks.
    >
    > Larry.




  3. #3
    Bob Phillips
    Guest

    Re: Deletion of rows where a value is satisfied

    See response in .excel, and please refrain from multi-posting.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Larry Wallis" <[email protected]> wrote in message
    news:[email protected]...
    > I have a spreadsheet with 3 colums. Columns are headed Part Number,
    > Description and Qty.
    >
    > What I would like to do is delete all rows where the qty value is zero.
    >
    > I can't do this using auto filter as I have some small sub headings within
    > the list and want them to stay visible.
    >
    > Any ideas please?
    >
    > Many thanks.
    >
    > Larry.




  4. #4
    Larry Wallis
    Guest

    Re: Deletion of rows where a value is satisfied

    On Tue, 22 Feb 2005 12:47:33 -0000, Bob Phillips wrote:

    > See response in .excel, and please refrain from multi-posting.


    Sorry Bob. Thought it was OK to multi-post as long as not to more than
    three groups.

    Wasn't sure whether this (depending on the answer) may be covered in
    various groups.

    Larry.

  5. #5
    Tom Ogilvy
    Guest

    Re: Deletion of rows where a value is satisfied

    Sub DD()
    Dim rng as Range, i as Long
    set rng = cells(rows.count,3).End(xlup)
    for i = rng.row to 2 step - 1
    if not isempty(cells(i,3)) then
    if cells(i,3).Value = 0 then
    cells(i,3).EntireRow.Delete
    end if
    end if
    Next
    end Sub

    --
    Regards,
    Tom Ogilvy

    "Larry Wallis" <[email protected]> wrote in message
    news:[email protected]...
    > I have a spreadsheet with 3 colums. Columns are headed Part Number,
    > Description and Qty.
    >
    > What I would like to do is delete all rows where the qty value is zero.
    >
    > I can't do this using auto filter as I have some small sub headings within
    > the list and want them to stay visible.
    >
    > Any ideas please?
    >
    > Many thanks.
    >
    > Larry.




  6. #6
    Bob Phillips
    Guest

    Re: Deletion of rows where a value is satisfied

    Larry,

    Cross-post, that is, include all groups in the same post. When we read from
    one, they all get read then.

    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Larry Wallis" <[email protected]> wrote in message
    news:[email protected]...
    > On Tue, 22 Feb 2005 12:47:33 -0000, Bob Phillips wrote:
    >
    > > See response in .excel, and please refrain from multi-posting.

    >
    > Sorry Bob. Thought it was OK to multi-post as long as not to more than
    > three groups.
    >
    > Wasn't sure whether this (depending on the answer) may be covered in
    > various groups.
    >
    > Larry.




  7. #7
    Larry Wallis
    Guest

    Re: Deletion of rows where a value is satisfied

    On Tue, 22 Feb 2005 13:15:28 -0000, Bob Phillips wrote:

    > Larry,
    >
    > Cross-post, that is, include all groups in the same post. When we read from
    > one, they all get read then.


    Sorry mate. Thought I was.

    Larry.

  8. #8
    Bob Phillips
    Guest

    Re: Deletion of rows where a value is satisfied

    Larry,

    Seems to be me that is the problem not you. Just re-looked at your OP, and
    that is exactly what you did. I seem to be getting problems, earlier I
    couldn't see my reply, then I swear I saw a response from Jason Morin that I
    can't see now. My only excuse is that I got confused by it all :-(

    Apologies again for casting doubt on you (hope my original answer helped|).

    Bob


    "Larry Wallis" <[email protected]> wrote in message
    news:[email protected]...
    > On Tue, 22 Feb 2005 13:15:28 -0000, Bob Phillips wrote:
    >
    > > Larry,
    > >
    > > Cross-post, that is, include all groups in the same post. When we read

    from
    > > one, they all get read then.

    >
    > Sorry mate. Thought I was.
    >
    > Larry.




  9. #9
    Larry Wallis
    Guest

    Re: Deletion of rows where a value is satisfied

    On Tue, 22 Feb 2005 13:26:18 -0000, Bob Phillips wrote:

    > Larry,
    >
    > Seems to be me that is the problem not you. Just re-looked at your OP, and
    > that is exactly what you did. I seem to be getting problems, earlier I
    > couldn't see my reply, then I swear I saw a response from Jason Morin that I
    > can't see now. My only excuse is that I got confused by it all :-(
    >
    > Apologies again for casting doubt on you (hope my original answer helped|).
    >
    > Bob
    >
    >
    > "Larry Wallis" <[email protected]> wrote in message
    > news:[email protected]...
    >> On Tue, 22 Feb 2005 13:15:28 -0000, Bob Phillips wrote:
    >>
    >>> Larry,
    >>>
    >>> Cross-post, that is, include all groups in the same post. When we read

    > from
    >>> one, they all get read then.

    >>
    >> Sorry mate. Thought I was.
    >>
    >> Larry.


    No problem at all Bob. Yes thanx, original answer was just what I was
    looking for.

    Thanx Bob.

    Larry.

  10. #10
    Larry Wallis
    Guest

    Re: Deletion of rows where a value is satisfied

    On Tue, 22 Feb 2005 08:00:59 -0500, Tom Ogilvy wrote:

    > Sub DD()
    > Dim rng as Range, i as Long
    > set rng = cells(rows.count,3).End(xlup)
    > for i = rng.row to 2 step - 1
    > if not isempty(cells(i,3)) then
    > if cells(i,3).Value = 0 then
    > cells(i,3).EntireRow.Delete
    > end if
    > end if
    > Next
    > end Sub


    Thanks Tom.

    Larry.

+ 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