Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-12-2014, 01:23 AM
macropod's Avatar
macropod macropod is offline Find and Delete Rows based on a range Windows 7 32bit Find and Delete Rows based on a range Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,512
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:
Code:
Sub DeleteExcess()
Application.ScreenUpdating = False
Dim lRow As Long, cRow As Long
With ActiveSheet
  lRow = .Cells.SpecialCells(xlCellTypeLastCell).Row
  For cRow = lRow To 5 Step -1
    Select Case .Cells(cRow, 1).Value
      Case 5000 To 5999, 7500 To 8299, 8400 To 9599, 9700 To 9999
        .Cells(cRow, 1).EntireRow.Delete
      Case Else
    End Select
  Next
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Find and Delete Rows damaniam Word VBA 1 03-11-2014 06:54 AM
Find and Delete Rows based on a range Delete Range After Bookmark? VBA_Elfe Word VBA 3 04-05-2013 05:05 AM
Find and Delete Rows based on a range Word Macro to find and delete rows that contain adjacent cells containing "." AlexanderJohnWilley Word VBA 7 11-08-2012 10:15 AM
Can't delete range - error 5904 expatriate Word VBA 1 06-03-2011 12:12 AM
Find and Delete Rows based on a range How to remove blank rows from a specified range? Learner7 Excel 1 04-19-2011 02:45 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:44 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft