gheyman
Well-known Member
- Joined
- Nov 14, 2005
- Messages
- 2,341
- Office Version
- 365
- Platform
- Windows
I need to delete each row if the content for the first 5 left characters = "10-TX"
Down Column M I have data that looks like 10-FL01-25 or 10-TX-04-028 or 10-TX-03-02 or 10-FL02-01....
I want to delete the Rows that either have "TX" (Or if that's too difficult then delete where the left 5 characters equal "10-TX")
Not sure how to modify this to do that.
Down Column M I have data that looks like 10-FL01-25 or 10-TX-04-028 or 10-TX-03-02 or 10-FL02-01....
I want to delete the Rows that either have "TX" (Or if that's too difficult then delete where the left 5 characters equal "10-TX")
Not sure how to modify this to do that.
Code:
Sub DeleteIfTexasPart()
'Author: G Heyman 191111
'Delete Rows where Comp_Type is not "Statndard"
'I is where the Comp Type is
Dim LR As Long, l As Long
LR = Range("M" & Rows.Count).End(xlUp).Row
For Z = LR To 2 Step -1
If Range("M" & Z).Value = XXXXXX Then Rows(Z).Delete
Next Z
End Sub