+ Reply to Thread
Results 1 to 4 of 4

Delete a row if blank cell

  1. #1
    mohd21uk via OfficeKB.com
    Guest

    Delete a row if blank cell

    Hi,

    I would like to delete a row if the a cell in a column is blank. For e.g. if
    a cell in column E is blank I would like to delete the whole row. I would
    like to do this in VBA code

    --
    Message posted via OfficeKB.com
    http://www.officekb.com/Uwe/Forums.a...l-new/200604/1

  2. #2
    CLR
    Guest

    RE: Delete a row if blank cell

    Here's one I got from the group some time ago.....sorry, don't remember who
    or when..........

    Public Sub DeleteBlanks()
    With ActiveSheet
    .Range(.Cells(1, ActiveCell.Column), _
    .Cells(65536, ActiveCell.Column)).Select
    End With
    Selection.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    ActiveSheet.UsedRange
    ActiveCell.Select
    End Sub

    Vaya con Dios,
    Chuck, CABGx3



    "mohd21uk via OfficeKB.com" wrote:

    > Hi,
    >
    > I would like to delete a row if the a cell in a column is blank. For e.g. if
    > a cell in column E is blank I would like to delete the whole row. I would
    > like to do this in VBA code
    >
    > --
    > Message posted via OfficeKB.com
    > http://www.officekb.com/Uwe/Forums.a...l-new/200604/1
    >


  3. #3
    Don Guillett
    Guest

    Re: Delete a row if blank cell

    or

    Sub DeleteBlankRowsInActiveColumn()
    ac = ActiveCell.Column
    lr = Cells(Rows.Count, ActiveCell.Column).End(xlUp).Row
    Range(Cells(1, ac), Cells(lr, ac)). _
    SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    End Sub

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "mohd21uk via OfficeKB.com" <u20517@uwe> wrote in message
    news:5eb7b0aab4723@uwe...
    > Hi,
    >
    > I would like to delete a row if the a cell in a column is blank. For e.g.
    > if
    > a cell in column E is blank I would like to delete the whole row. I would
    > like to do this in VBA code
    >
    > --
    > Message posted via OfficeKB.com
    > http://www.officekb.com/Uwe/Forums.a...l-new/200604/1




  4. #4
    Don Guillett
    Guest

    Re: Delete a row if blank cell

    or

    Sub DeleteBlankRowsInActiveColumn()
    ac = ActiveCell.Column
    lr = Cells(Rows.Count, ActiveCell.Column).End(xlUp).Row
    Range(Cells(1, ac), Cells(lr, ac)). _
    SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    End Sub

    --
    Don Guillett
    SalesAid Software
    [email protected]
    "mohd21uk via OfficeKB.com" <u20517@uwe> wrote in message
    news:5eb7b0aab4723@uwe...
    > Hi,
    >
    > I would like to delete a row if the a cell in a column is blank. For e.g.
    > if
    > a cell in column E is blank I would like to delete the whole row. I would
    > like to do this in VBA code
    >
    > --
    > Message posted via OfficeKB.com
    > http://www.officekb.com/Uwe/Forums.a...l-new/200604/1




+ 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