Splitting cells with 2 delimiters "; and |", can it be done?

gadgetic

New Member
Joined
Apr 26, 2015
Messages
9
Hi

This is my first post. I hope that it makes sense. I export a sales csv from my website which contains all the address information for the various couriers that I use. Recently orders overseas have increased and I am forever filling in CN22 forms, so I decided to also export out item information. I figured to keep things simple, I would keep one row per one order, but getting multiple item data onto the same row meant I had to use some new delimiters.

All the address information is "comma" separated but now I have introduced a new column called "Item Information" which has 3 bits of data

- Item Name
- Item Price
- Currency

They are separated by ";"

If there is more than 1 item then I use "|" to seperate.

This way all the Item Information is inside one cell and on the same row as the address.

Here is an example:

Thin Strap Plain Camisole;10.5094;USD|Thin Strap Plain Camisole;10.4183;USD|Thin Strap Plain Camisole;10.6157;USD|

Now what I need to be able to do is split the above data into separate cells in a meaningful way, so that I can list the information in a table on a CN22, where I can total the prices at the bottom.

Can anybody help? Preferably I would like some vba macro code, so that this task can be automated.

Many Thanks

Gurpreet
 
Code:
[COLOR=darkblue]Sub[/COLOR] Some[COLOR=darkblue]Sub[/COLOR]()
    Range("Z2", Range("Z" & Rows.Count).End(xlUp)).TextToColumns _
        DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, _
        ConsecutiveDelimiter:=False, Tab:=False, Semicolon:=True, _
        Comma:=False, Space:=False, Other:=True, OtherChar:="|"
[COLOR=darkblue]End[/COLOR] Sub
 
Upvote 0

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,223,230
Messages
6,170,883
Members
452,364
Latest member
springate

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