+ Reply to Thread
Results 1 to 3 of 3

Deleting entire row if value in column A = 0

Hybrid View

pyufak Deleting entire row if value... 02-07-2009, 05:26 PM
ravichander Re: Deleting entire row if... 02-07-2009, 05:33 PM
ravichander Re: Deleting entire row if... 02-07-2009, 05:43 PM
  1. #1
    Registered User
    Join Date
    01-26-2009
    Location
    London
    MS-Off Ver
    Excel 2003
    Posts
    3

    Deleting entire row if value in column A = 0

    Hi guys, I have this formula from row 1-500 in column A

    =IF(Sheet1!A2="",Sheet1!A1,"0").

    Where the output is 0 i wish to remove the entire row, however i have being struggling to build / find a macro to do this. Is this because my excel is not seeing "0" but the formula instead? Any help or links to the macro to use would be much appreciated.

    Many thanks

    Ian

  2. #2
    Forum Contributor
    Join Date
    06-23-2008
    Posts
    116

    Re: Deleting entire row if value in column A = 0

    I entered the formula and Excel 2007 displayed a circular reference warning. When I clicked Cancel on that dialog box, Cell A1 which had the formula now displayed a 0. I can still see the formula in the formular bar though.

    - Ravi

  3. #3
    Forum Contributor
    Join Date
    06-23-2008
    Posts
    116

    Re: Deleting entire row if value in column A = 0

    Here is some code that will select and delete a row if the value of Cell A1 is zero.

    Sub DeleteRow()
        Sheets("Sheet1").Range("A1").Select
        If ActiveCell = 0 Then
            Rows("1:1").Select
            Selection.Delete Shift:=xlUp
            Range("A1").Select
        Else
            Sheets("Sheet1").Range("A1").Select
        End If
    End Sub
    I am not familiar with loops as yet.

    - Ravi

+ 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