+ Reply to Thread
Results 1 to 3 of 3

Auto row deletion

  1. #1
    Registered User
    Join Date
    02-15-2005
    Posts
    5

    Auto row deletion

    undefined I open a csv file into excel and it is sorted into columns. two of the columns have values in them. If both of the columns, for each row, have 0.00 as the value I want to delete that row, there are usually a lot of these rows and I don't want to have to manually go down a list
    of 100+ rows and delete the rows where there are two zero values. How can I automate this ?

  2. #2
    Jef Gorbach
    Guest

    Re: Auto row deletion

    The quick-n-dirty answer - no error checking/etc but should get you started.
    Change Cells(row,1) to Range("A"&row) if prefer.
    Either way, presumed data being checked are in columns A and B so correct as
    needed.

    Sub mad()
    'manipulate a copy of the data
    Sheets("Sheet1").Copy After:=Sheets(Sheets.Count)
    Sheets(Sheets.Count).Name = "Print"
    '
    finalrow = Range("A65536").End(xlUp).Row
    '
    For Row = 2 To finalrow
    If Cells(Row, 1).Value = 0 And _
    Cells(Row, 2).Value = 0 Then
    Cells(Row, 1).EntireRow.Delete
    End If
    Next
    End Sub

    "rogeraw" <rogeraw.1sf42a_1121778305.0304@excelforum-nospam.com> wrote in
    message news:rogeraw.1sf42a_1121778305.0304@excelforum-nospam.com...
    >
    > undefined I open a csv file into excel and it is sorted into
    > columns. two of the columns have values in them. If both of the
    > columns, for each row, have 0.00 as the value I want to delete that
    > row, there are usually a lot of these rows and I don't want to have to
    > manually go down a list
    > of 100+ rows and delete the rows where there are two zero values. How
    > can I automate this ?
    >
    >
    > --
    > rogeraw
    > ------------------------------------------------------------------------
    > rogeraw's Profile:

    http://www.excelforum.com/member.php...o&userid=19964
    > View this thread: http://www.excelforum.com/showthread...hreadid=388316
    >




  3. #3
    Registered User
    Join Date
    02-15-2005
    Posts
    5
    To Jef G. or anyone else . . .

    Thanks for reply but your solution does not work and last time I
    programmed was in 1-2-3 in the late 80's so I cannot modify.

    The zero values are in columns C & D so if on any row the
    value in cols C and D are 0.00 I want the row deleting.

    Please revisit the macro, thanks.

    Roger :-(
    Last edited by rogeraw; 08-19-2005 at 08:45 AM.

+ 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