Excel VBA to copy certain data form a cell and past into empty cell

kpost

Banned user
Joined
Apr 25, 2021
Messages
7
Office Version
  1. 365
Platform
  1. Windows
I am newer at creating VBa scripts. Need some help. I am working on creating a VBA script to copy data from a cell to another cell. Below is a sample data:

LIN**BP*6ZS52WA6AA~

SN1**2*EA*6~

So in this example the data that is in between the BP* ~ will be pasted in a separate cell. So the end result in the empty cell would be
6ZS52WA6AA
Similar to the data in between SN1** * * ~
The end result would be one cell would have 2 the next cell EA and the last cell 6.
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
I think your gonna need to provide some more examples so that some patterns can be found.

Right now, all I see is if a string that starts with 3 characters, followed by 2 asterisks (*) and then the next character is a number (#) then split that number and all remaining non '*' and '~' characters into separate cells.
And, if a string that starts with 3 characters, followed by 2 asterisks (*) and then the next characters are two letters and an '*' then copy the remaining characters up to the ~ into one cell.
 
Upvote 0

Forum statistics

Threads
1,215,063
Messages
6,122,935
Members
449,094
Latest member
teemeren

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