I'd like to make this macro interactive by adding a box to select column and text with wildcards
Currently I change the "F" and the "*:*" in the code below and then run the macro. But, I'd like to make it interactive so others with no experience with vba can do it.
Any help greatly appreciated.
Jim
rows in macro that are affected
With .Cells(Lrow,"F") ‘insert column
If Not IsError(.Value) Then
If .Value Like "*:*" Then .E. . . .
Sub Delete_Row_IfCellContainsCertainText ()
Dim Firstrow As Long
Dim Lastrow As Long
Dim Lrow As Long
Dim CalcMode As Long
Dim ViewMode As Long
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
With ActiveSheet
.Select
ViewMode = ActiveWindow.View
ActiveWindow.View = xlNormalView
.DisplayPageBreaks = False
Firstrow = .UsedRange.Cells(1).Row
Lastrow = .UsedRange.Rows(.UsedRange.Rows.Count).Row
For Lrow = Lastrow To Firstrow Step -1
With .Cells(Lrow,"F") ‘insert column
If Not IsError(.Value) Then
If .Value Like "*:*" Then .EntireRow.Delete ‘insert common text with wildcard
End If
End With
Next Lrow
End With
ActiveWindow.View = ViewMode
With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
End Sub
Bookmarks