Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 177
Default Delete Rows Where Value in Column V is Less than 2.5?

Hi, this question is related to another Auto Filter macro question I had last
week (see below for the URL if interested).

I think the title of this question is clear enough. I have about 2000 rows
of data. I would like to delete all the rows where the Value in any cell in
Column V is less than 2.5.

How do I do this? Thanks very much!

Regards
Steve C





http://www.microsoft.com/office/comm...xp=&sloc=en-us


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Delete Rows Where Value in Column V is Less than 2.5?

Hi Steve

We used this in that thread

DeleteValue = "*Total*"


Now we use

DeleteValue = "<2.5"

Sub Delete_with_Autofilter()
Dim DeleteValue As String
Dim rng As Range

DeleteValue = "<2.5"
With ActiveSheet
.Range("V1:V2000").AutoFilter Field:=1, Criteria1:=DeleteValue
With ActiveSheet.AutoFilter.Range
On Error Resume Next
Set rng = .Offset(1, 0).Resize(.Rows.Count - 1, 1) _
.SpecialCells(xlCellTypeVisible)
On Error GoTo 0
If Not rng Is Nothing Then rng.EntireRow.Delete

End With
.AutoFilterMode = False
End With
End Sub





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


"SteveC" wrote in message ...
Hi, this question is related to another Auto Filter macro question I had last
week (see below for the URL if interested).

I think the title of this question is clear enough. I have about 2000 rows
of data. I would like to delete all the rows where the Value in any cell in
Column V is less than 2.5.

How do I do this? Thanks very much!

Regards
Steve C





http://www.microsoft.com/office/comm...xp=&sloc=en-us




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 with nothing in Column B marlea[_12_] Excel Programming 3 January 31st 06 03:39 PM
delete rows if value in column D is repeated DKY[_70_] Excel Programming 5 August 12th 05 11:07 PM
Delete all rows where Column A contains Text D Hafer - TFE Excel Worksheet Functions 3 July 1st 05 06:03 PM
Is there a quick way to delete all duplicate rows in a column? Jellaby Excel Discussion (Misc queries) 3 May 16th 05 10:47 PM
Delete All Rows That Column A value is not in Column A of Sheet2 [email protected] Excel Programming 2 September 3rd 04 09:13 PM


All times are GMT +1. The time now is 09:30 AM.

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

About Us

"It's about Microsoft Excel"