HellNoJello
New Member
- Joined
- Sep 21, 2005
- Messages
- 9
I want to delete all the rows in column A if they contain the text "FILENET TRANSMITTAL FORM" How can I do this?
Thanks.
Thanks.
Sub DeleteRowByText()
Dim rng As Range, rng2 As Range
Set rng = Range("A65536").End(xlUp)
Do Until rng.Row = 2
Set rng2 = rng.Offset(-1)
If rng = "FILENET TRANSMITTAL FORM" Then rng.EntireRow.Delete
Set rng = rng2
Loop
End Sub
Sub deleterows_autofilter()
'header in A1
'data without gaps
Application.ScreenUpdating = False
Range("A1").AutoFilter Field:=1, Criteria1:="FILENET TRANSMITTAL FORM"
Range("A2:A" & Range("A1").End(xlDown).Row).EntireRow.Delete
ActiveSheet.AutoFilterMode = False
Application.ScreenUpdating = True
End Sub
Sub delete_range()
Dim rng As Range
Dim LR As Long 'last row
Columns(1).Insert
Application.ScreenUpdating = False
Set rng = Range(Cells(2, 1), Cells(Rows.Count, 2).End(xlUp).Offset(0, -1))
With rng
.FormulaR1C1 = "=IF(RC[1]=""FILENET TRANSMITTAL FORM"","""",1)"
.Copy
.PasteSpecial Paste:=xlValues
.EntireRow.Sort Key1:=rng(1), Order1:=xlDescending, Header:=xlNo
LR = .SpecialCells(xlCellTypeConstants, 2).Cells.Count + 1
.EntireColumn.Delete
Range("A2:A" & LR).Delete
End With
Application.ScreenUpdating = True
End Sub