Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete record based on a value
Hello,
I would like to be able to delete all values greater than 60 on a spreadsheet. -- Thank-you and all suggestions are appreciated. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete record based on a value
Why not just sort and delete?
-- HTH... Jim Thomlinson "Anauna" wrote: Hello, I would like to be able to delete all values greater than 60 on a spreadsheet. -- Thank-you and all suggestions are appreciated. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete record based on a value
Hi
This example use AutoFilter to do this The first cell in the range is the header cell Sub Delete_with_Autofilter() Dim DeleteValue As String Dim rng As Range DeleteValue = "60" With ActiveSheet .Range("A1:A100").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 "Anauna" wrote in message ... Hello, I would like to be able to delete all values greater than 60 on a spreadsheet. -- Thank-you and all suggestions are appreciated. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete record based on a value
Assuming you mean all values in a single column, then you should put on
Autofilter and set the criterion to =60, then delete results. If you need to look over every cell in the worksheet for values =60, that's a different story. Sub DelValues() Dim c As Range For Each c In activeSheet.UsedRange If c.Value = 60 And IsNumeric(c.Value) Then c.Delete Next 'c End Sub "Anauna" wrote in message ... Hello, I would like to be able to delete all values greater than 60 on a spreadsheet. -- Thank-you and all suggestions are appreciated. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Formula to Delete Duplicates but keep one record | Excel Discussion (Misc queries) | |||
find last record in macro and delete all after | Excel Discussion (Misc queries) | |||
Delete record(s) in other cells based on value of one cell. | Excel Discussion (Misc queries) | |||
How to delete duplicated records. Each record has four lines | Excel Discussion (Misc queries) | |||
How To Delete First Record In A Text File | Excel Programming |