![]() |
|
#17
|
|||
|
|||
|
Hi Joli,
I put it at the end of the code and go an error. It didn't remove the rows in any of the worksheets. .Range(.Cells(1, 1), .Cells(lr, lc)).AutoFilter 4, "<11" Thanks for trying. I'll keep working on it. I did find another way to do it. Probably not the best way. I set up conditional formulas on each sheet that highlights anything in Yellow if the Age column is less than 11. Then I ran this code on one sheet that I found on the net: Code:
Sub DeleteRowslessthan10()
Dim rg As Range
Dim i As Long
On Error Resume Next
Set rg = Application.InputBox("Please select a single column range of cells." & vbLf & _
"If value is Less than 10,that row will be deleted.", _
Default:="D2:D3000", Type:=8)
On Error GoTo 0
Application.ScreenUpdating = False
If Not rg Is Nothing Then
Set rg = Intersect(rg, ActiveSheet.UsedRange)
If Not rg Is Nothing Then
For i = rg.Rows.Count To 1 Step -1
If IsError(rg.Cells(i, 1).Value) Then
rg.Rows(i).EntireRow.Delete
ElseIf UCase(rg.Cells(i, 1).Value) = "N/A" Then
rg.Rows(i).EntireRow.Delete
ElseIf rg.Cells(i, 1).Value = "" Then
ElseIf IsNumeric(rg.Cells(i, 1)) Then
If rg.Cells(i, 1).Value < 11 Then rg.Rows(i).EntireRow.Delete
End If
Next
End If
End If
End Sub
Thoughts ? Thanks in Advance GBaker |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Grouping table rows to prevent individual rows from breaking across pages
|
dennist77 | Word | 1 | 10-29-2013 11:39 PM |
Count rows and add blank rows accordingly
|
Hoochtheseal | Word VBA | 1 | 01-29-2013 09:23 PM |
rows in word?
|
j2b3 | Word Tables | 3 | 07-19-2012 03:59 PM |
merging rows and creating sub-rows
|
gib65 | Excel | 2 | 12-09-2011 02:09 PM |
How to remove blank rows from a specified range?
|
Learner7 | Excel | 1 | 04-19-2011 02:45 AM |