pioshelby1980com
New Member
- Joined
- Jan 2, 2024
- Messages
- 17
- Office Version
- 365
- Platform
- Windows
I have this code that I managed to cobble together to delete some rows:
I would like to add a way to search for the string "CE Order" and if it exists then delete the rows but if it doesn't, then don't.
Can anyone help with this?
Sub RemoveCEOrder()
Dim foundRange As Range
Set foundRange = Cells.Find(What:="CE Order", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False)
Rows(6).EntireRow.Delete
Rows(6).EntireRow.Delete
Rows(6).EntireRow.Delete
Rows(30).EntireRow.Delete
Rows(30).EntireRow.Delete
Rows(30).EntireRow.Delete
With Range("B29:P29").Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Color = RGB(68, 114, 196)
.Weight = xlThick
End With
End Sub
I would like to add a way to search for the string "CE Order" and if it exists then delete the rows but if it doesn't, then don't.
Can anyone help with this?