Hello,
I would like to be able to delete all values greater than 60 on a
spreadsheet.
--
Thank-you and all suggestions are appreciated.
Hello,
I would like to be able to delete all values greater than 60 on a
spreadsheet.
--
Thank-you and all suggestions are appreciated.
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.
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" <Anauna@discussions.microsoft.com> wrote in message news:97E3B64B-3C69-4F1E-BB43-C249D28069FA@microsoft.com...
> Hello,
>
> I would like to be able to delete all values greater than 60 on a
> spreadsheet.
> --
> Thank-you and all suggestions are appreciated.
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" <Anauna@discussions.microsoft.com> wrote in message
news:97E3B64B-3C69-4F1E-BB43-C249D28069FA@microsoft.com...
> Hello,
>
> I would like to be able to delete all values greater than 60 on a
> spreadsheet.
> --
> Thank-you and all suggestions are appreciated.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks