clear whole item into cell based on two words

abdo meghari

Active Member
Joined
Aug 3, 2021
Messages
465
Office Version
  1. 2019
hi
I would delete whole item from the cells in column B where is existed two words " Purchase Order"
orginal data
1 (version 2).xlsb
ABC
1SrDescriptionAccepted Quantity
21BS 1200R20 G580 TCF Purchase Order: PO-2022-000091,147 Unit
32BS 13 R22.5 R187 Purchase Order: PO-2022-0000960 Unit
43BS 315/80 R22.5 R184 Purchase Order: PO-2022-0000998 Unit
54BS 315/80 R22.5 G580 Purchase Order: PO-2022-0000920 Unit
1

result should be
1 (version 2).xlsb
ABC
1SrDescriptionAccepted Quantity
21BS 1200R20 G580 TCF1,147 Unit
32BS 13 R22.5 R187 60 Unit
43BS 315/80 R22.5 R184 98 Unit
54BS 315/80 R22.5 G580 20 Unit
1

thanks
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
How about
VBA Code:
Sub abdomeghari()
   With Range("B2", Range("B" & Rows.Count).End(xlUp))
      .Replace " Purchase Order*", "", xlPart, , False, , False, False
   End With
End Sub
 
Upvote 0
Solution

Forum statistics

Threads
1,215,472
Messages
6,125,003
Members
449,203
Latest member
Daymo66

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