Delete items after specific words in array

leap out

Active Member
Joined
Dec 4, 2020
Messages
288
Office Version
  1. 2016
  2. 2010
Hello
I have data in columns A: F some words in column C2:C8000 in specific sheets like this
SRT RETHY VOU 20000
SRT RETHY VOU 20001
AVRT REWONM SN90000
AVRT REWONM SN90001
AVRT REWONM SN90002
VOUCF AQWWW NMJ78900
ASD WERRRY 1299HA HJKJU8
there are many items are existed in specific sheets(SH1,DATA,MAIN,COS)
so what I want macro to put specific sheets names in array and put items in array like this
("SRT RETHY","AVRT REWONM","VOUCF","ASD WERRRY 1299HA")
the macro should delete any items are existed after them based on words in array and based on specific sheets names in array
the result should be in column C like this
SRT RETHY
SRT RETHY
AVRT REWONM
AVRT REWONM
AVRT REWONM
VOUCF
ASD WERRRY 1299HA
thanks
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().

Forum statistics

Threads
1,223,101
Messages
6,170,116
Members
452,302
Latest member
TaMere

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