View Single Post
 
Old 03-18-2017, 09:17 AM
Logit Logit is offline Windows 10 Office 2007
Expert
 
Join Date: Jan 2017
Posts: 591
Logit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the roughLogit is a jewel in the rough
Default

Code:
Option Explicit

Sub DeleteRowNoInclude()
'Update20140618
Dim xRow As Range
Dim rng As Range
Dim WorkRng As Range
Dim xStr As String
Dim i As Integer
On Error Resume Next
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", WorkRng.Address, Type:=8)
xStr = Application.InputBox("Text", Type:=2)
Application.ScreenUpdating = False
For i = WorkRng.Rows.Count To 1 Step -1
    Set xRow = WorkRng.Rows(i)
    Set rng = xRow.Find(xStr, LookIn:=xlValues)
        
    If Not rng Is Nothing Then
       xRow.Delete
    End If
Next
Application.ScreenUpdating = True
End Sub
Attached Files
File Type: xlsm Delete Row.xlsm (15.5 KB, 25 views)