P
parteegolfer
I have this macro I want to delete any row with the first 6 characters
that start with "Inshop" in column (A). there could be other characters
within the cell that contains "Inshop" so I need some sort of wildcard
in the code below. Any suggestions?
Code:
--------------------
Option Explicit
Public Sub DeleteRows()
Const TestColumn As Long = 1
Dim cRows As Long
Dim i As Long
'first, count the rows to operate on
cRows = Cells(Rows.Count, TestColumn).End(xlUp).Row
For i = cRows To 2 Step -1
'check if current row contains Inshop*
If Cells(i, TestColumn).Value = "Inshop*" Then
Cells(i, TestColumn).EntireRow.Delete
End If
Next i
End Sub
that start with "Inshop" in column (A). there could be other characters
within the cell that contains "Inshop" so I need some sort of wildcard
in the code below. Any suggestions?
Code:
--------------------
Option Explicit
Public Sub DeleteRows()
Const TestColumn As Long = 1
Dim cRows As Long
Dim i As Long
'first, count the rows to operate on
cRows = Cells(Rows.Count, TestColumn).End(xlUp).Row
For i = cRows To 2 Step -1
'check if current row contains Inshop*
If Cells(i, TestColumn).Value = "Inshop*" Then
Cells(i, TestColumn).EntireRow.Delete
End If
Next i
End Sub