+ Reply to Thread
Results 1 to 2 of 2

Macro wont run

  1. #1
    Dave
    Guest

    Macro wont run

    Hi
    The macro below wont run. When I select a column of data ie: A2:A58 it is
    suppose to delete the entire row if a cell in my selection is blank.
    All my other macros run OK.
    I'm running Excel 2003.
    Will be grateful for any help.

    Public Sub DeleteRowOnCell()

    On Error Resume Next
    Selection.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    ActiveSheet.UsedRange

    End Sub


  2. #2
    Norman Jones
    Guest

    Re: Macro wont run

    Hi Dave,

    Your macro runs perfectly well in the sense that it deletes entire rows
    corresponding to blank cells in the selected range.

    It will fail to delete rows only if the selection includes no empty cells.
    Note that appearance and fact are not necessarily synonymous in respect of
    empty cells.

    ---
    Regards,
    Norman



    "Dave" <Dave@discussions.microsoft.com> wrote in message
    news:DAA66B85-6B11-4019-B254-089F01610D02@microsoft.com...
    > Hi
    > The macro below wont run. When I select a column of data ie: A2:A58 it is
    > suppose to delete the entire row if a cell in my selection is blank.
    > All my other macros run OK.
    > I'm running Excel 2003.
    > Will be grateful for any help.
    >
    > Public Sub DeleteRowOnCell()
    >
    > On Error Resume Next
    > Selection.SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    > ActiveSheet.UsedRange
    >
    > End Sub
    >




+ 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