PC Review


Reply
Thread Tools Rate Thread

Auto row deletion

 
 
rogeraw
Guest
Posts: n/a
 
      19th Jul 2005

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

 
Reply With Quote
 
 
 
 
Jef Gorbach
Guest
Posts: n/a
 
      19th Jul 2005
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" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
>
> 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
>



 
Reply With Quote
 
rogeraw
Guest
Posts: n/a
 
      29th Jul 2005

To Jef G.,

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


--
rogeraw
------------------------------------------------------------------------
rogeraw's Profile: http://www.excelforum.com/member.php...o&userid=19964
View this thread: http://www.excelforum.com/showthread...hreadid=388316

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto deletion of duplicates mrwhitescotland Microsoft Access Queries 5 11th Sep 2008 03:58 PM
Auto time deletion Blair Microsoft Access Form Coding 0 14th Jan 2007 07:37 PM
Auto Time Deletion Blair Mullen Microsoft Access Security 0 13th Jan 2007 04:22 AM
Row deletion and auto filter RMJames Microsoft Excel Programming 1 15th Mar 2006 01:40 PM
Row deletion and auto filter RMJames Microsoft Excel Discussion 0 15th Mar 2006 11:08 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:47 AM.