delete entire row based on specific two words

abdo meghari

Active Member
Joined
Aug 3, 2021
Messages
465
Office Version
  1. 2019
hi
I would delete entire row where contains "Purchase Order" is existed in column B "
original data
1
ABC
1SrDescriptionAccepted Quantity
21BS 1200R20 G580 TCF1,147 Unit
3Purchase Order: PO-2022-00009
42BS 13 R22.5 R18760 Unit
5Purchase Order: PO-2022-00009
63BS 315/80 R22.5 R18498 Unit
7Purchase Order: PO-2022-00009
84BS 315/80 R22.5 G58020 Unit
9Purchase Order: PO-2022-00009
105BS 1400R20 VSJ TCF60 Unit
11Purchase Order: PO-2022-00009
126BS 1200R24 G580100 Unit
13Purchase Order: PO-2022-00009
147BS 385/65 R22.5 R16420 Unit
15Purchase Order: PO-2022-00009
1


result should n be
1
ABC
1SrDescriptionAccepted Quantity
21BS 1200R20 G580 TCF1,147 Unit
32BS 13 R22.5 R18760 Unit
43BS 315/80 R22.5 R18498 Unit
54BS 315/80 R22.5 G58020 Unit
65BS 1400R20 VSJ TCF60 Unit
76BS 1200R24 G580100 Unit
87BS 385/65 R22.5 R16420 Unit
1
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
How about
VBA Code:
Sub abdomeghari()
   Range("C:C").UnMerge
   With Range("B2", Range("B" & Rows.Count).End(xlUp))
      .Replace "Purchase Order*", "", xlPart, , False, , False, False
      .SpecialCells(xlBlanks).EntireRow.Delete
   End With
End Sub
 
Upvote 0
Solution
You're welcome & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,982
Messages
6,122,580
Members
449,089
Latest member
Motoracer88

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top