george hart
Board Regular
- Joined
- Dec 4, 2008
- Messages
- 241
I need to delete all rows in a worksheet and the one/s including the name "Other Vehicles" or "Class 57". The problem I have is using something like the below doesn't help when theres caps/blanks cells between text???
In short, find "Other Vehicles" or "Class 57" and delete everything below it.
Cells.Find(What:="Other Vehicles", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Activate
Rows("24:55").Select
Selection.Delete Shift:=xlUp
Rows("23:23").Select
Selection.Delete Shift:=xlUp
In short, find "Other Vehicles" or "Class 57" and delete everything below it.
Cells.Find(What:="Other Vehicles", After:=ActiveCell, LookIn:=xlFormulas _
, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Activate
Rows("24:55").Select
Selection.Delete Shift:=xlUp
Rows("23:23").Select
Selection.Delete Shift:=xlUp