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

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.

Forum statistics

Threads
1,223,894
Messages
6,175,254
Members
452,624
Latest member
gregg777

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