Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

EXCEL - Find and Delete for entire Rows?

Status
Not open for further replies.

gwrman

IS-IT--Management
Dec 20, 2005
94
CA
Is there a quick way in Excel 2003 to find all rows that contain a certain value in a given column?

Thanks
 


Hi,

A search would have returned a number of threads on this topic.

Try the AutoFilter and Delete.

Skip,

[glasses] [red]Be Advised![/red] The Vinyards of Texas have produced a wine with diuretic dimishment and urethric relief...
Pinot More![tongue]
 
=countif(A:A,"Criteria")

[tt]_____
[blue]-John[/blue][/tt]

Help us help you. Please read FAQ181-2886 before posting.
 
grr. Maybe I should go back to bed.

Either that, or read the header along with the post.

[tt]_____
[blue]-John[/blue][/tt]

Help us help you. Please read FAQ181-2886 before posting.
 
This would work for column B, adjust cells reference for other columns.
Code:
Sub DeleteRows()
    Dim LastRow As Long
    Dim i As Long
    LastRow = Cells(65536, 2).End(xlUp).Row
Application.ScreenUpdating = False
    For i = LastRow To 2 Step -1
        If Cells(i, 2).Value = "T" Then Cells(i, 2).EntireRow.Delete
    Next i
Application.ScreenUpdating = True
End Sub

Software: XL2002 on Win2K
Humanware: Older than dirt
 


Gray,

This is the MS Office Forum.

Code questions and solutions, belong in the VBA Visual Basic for Applications (Microsoft) Forum707.

Skip,

[glasses] [red]Be Advised![/red] The Vinyards of Texas have produced a wine with diuretic dimishment and urethric relief...
Pinot More![tongue]
 
Opps. Sorry about that. :-(

Software: XL2003 on WinXP
Software: Office 2004 on Mac OS X 10.3.9
Humanware: Older than dirt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top