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

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.

Forum statistics

Threads
1,216,101
Messages
6,128,841
Members
449,471
Latest member
lachbee

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