Using this code to dalete rows with 7VXX in column A:
my problem is with the:
MatchString = "7V "
line.
In column a are data such as:
5D7V
and
7VJH
I want to delete only the rows with 7V as the first 2 characters.
"7V" deletes both &
"7V " does not work at all.
ANY help greatly appreciated.
Hope everyone had a great week end!
cliff
Code:
AC = Split(ActiveCell.EntireColumn.Address(, False), ":")
ActiveColumn = AC(0)
SearchColumn = "A:A"
On Error Resume Next
Set MyRange = Columns(SearchColumn)
On Error GoTo 0
If MyRange Is Nothing Then Exit Sub
MatchString = "7V "
Set c = MyRange.Find(What:=MatchString, After:=MyRange.Cells(1), LookIn:=xlValues, LookAt:=xlPart)
If Not c Is Nothing Then
Set DelRange = c
FirstAddress = c.Address
Do
Set c = MyRange.FindNext(c)
Set DelRange = Union(DelRange, c)
Loop While FirstAddress <> c.Address
End If
If Not DelRange Is Nothing Then DelRange.EntireRow.Delete
my problem is with the:
MatchString = "7V "
line.
In column a are data such as:
5D7V
and
7VJH
I want to delete only the rows with 7V as the first 2 characters.
"7V" deletes both &
"7V " does not work at all.
ANY help greatly appreciated.
Hope everyone had a great week end!
cliff