Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 211
Default Delete rows based on value...

Hi...

I have 4000 vertical records. In columns A, B and C I have product
information. In column D I have a value that ranages from 0-5. I need to
delete all rows were the value in cell D is 0 (zero). Has anyone got any
useful code? I'm stuck and my brain is bleeding!

Thanks in advance G
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Delete rows based on value...

Hi

Start here
http://www.rondebruin.nl/delete.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl



"Gordon" wrote in message ...
Hi...

I have 4000 vertical records. In columns A, B and C I have product
information. In column D I have a value that ranages from 0-5. I need to
delete all rows were the value in cell D is 0 (zero). Has anyone got any
useful code? I'm stuck and my brain is bleeding!

Thanks in advance G



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default Delete rows based on value...

Sub DeleteRows()
Dim lRow as Long 'Last Row
Dim cnt as Long
lRow = Range("D" & Rows.Count).End(xlUp).Row
For cnt = lRow to 1 Step - 1
If Range("D" & cnt) = 0 Then Rows(cnt).Delete
Next
End Sub

HTH

Charles Chickering
Gordon wrote:
Hi...

I have 4000 vertical records. In columns A, B and C I have product
information. In column D I have a value that ranages from 0-5. I need to
delete all rows were the value in cell D is 0 (zero). Has anyone got any
useful code? I'm stuck and my brain is bleeding!

Thanks in advance G


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Delete rows based on value...

select the data, do data =filter=Autofilter

in the dropdown for D, select zero.

select all the records (except the header row) and delete

if you need code, turn on the macro recorder while you do it manually.

--
Regards,
Tom Ogilvy



"Gordon" wrote:

Hi...

I have 4000 vertical records. In columns A, B and C I have product
information. In column D I have a value that ranages from 0-5. I need to
delete all rows were the value in cell D is 0 (zero). Has anyone got any
useful code? I'm stuck and my brain is bleeding!

Thanks in advance G

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Rows based on value Sabosis Excel Worksheet Functions 4 October 28th 08 11:21 PM
Delete Rows Based on Words Cue Excel Discussion (Misc queries) 2 June 4th 08 06:42 AM
Delete rows based on criteria Chris_t_2k5 Excel Discussion (Misc queries) 2 April 11th 06 01:52 PM
Delete rows based on certain criteria Coal Miner Excel Discussion (Misc queries) 2 March 3rd 06 05:56 PM
Delete rows based on Cell name gmunro Excel Programming 1 November 25th 05 01:09 PM


All times are GMT +1. The time now is 04:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"