?
Solved

I'd like to delimit my text in column B (like text-to-columns feature) without having to pre-allocating free space on the right side.

Posted on 2016-11-18
5
Medium Priority
?
60 Views
Last Modified: 2016-11-20
Hi Experts,

I would like to use VBA to help me perform the following task:

Example:

A                     B                                                C
Invoice No.   Model Name.                           Cust Name
0001              BMW X5,Audi A4                     Lisa Marie Presley
0002              Volvo S80, Jaguar XJ,Audi A6  Johnny Depp
0003              Acura NSX                                 Angelina Jolie

I need a script to automatically sort the model of each invoice.

Example:

A                     B                                                C
Invoice No.   Model Name.                           Cust Name
0001              Audi A4, BMW X5,                     Lisa Marie Presley
0002              Audi A6, Jaguar XJ,Volvo S80   Johnny Depp
0003              Acura NSX                                  Angelina Jolie

And then immediately delimit text (aka Convert Text to Columns) in column B without having to overwriting data in column C.
 
Any idea how to write a script module to perform the above?


Please advice.

Thank you.

Brian
0
Comment
Question by:Brian Smith
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 22
ID: 41894003
where do you want the extra data from column B to go? Why not just move what is in column B to the last column and use Text-to-Columns?
0
 

Author Comment

by:Brian Smith
ID: 41894015
Hi Crystal,

Thank you for your response and sorry for the confusion,

Allow me clarify this further. Below is the desired output that I am trying to achieve (in full/semi-automation):

A                     B                        C                D                 E
Invoice No.   Model Name                                          Cust Name  
0001              Audi A4              BMW X5                       Lisa Marie Presley
0002              Audi A6,             Jaguar XJ   Volvo S80   Johnny Depp
0003              Acura NSX                                               Angelina Jolie

Once this is achieve, i will need to run  a macro template to auto pivot out the desired monthly table & chart before passing to other dept for further actions.

P/S: The data showing here is just a simplified version of mock-run data to illustrate and for better/easier to understand. But in reality, the xls data file is actually sharing among multiple dept and consisting hundreds of columns and thousands rows of value (and I am not allow  to make any modification in row/column format, otherwise the macro template will not work and will also create confusion to other dept).

Hope I had answer your question.

Thanks again.
0
 

Author Comment

by:Brian Smith
ID: 41894028
Additional Info:

I had tried the VBA script suggested on this Youtube tutorial:

https://www.youtube.com/watch?v=gZD0V2mJSCk

However, the  example given is this video is with an assumption that, the value of sSeparotor (e.g. dash, comma, etc) of every row  is always the same.

So, it doesn't apply to my case scenario, where the total number of comma in every row of column B is not fix.

It can be up to any value, depends on how many cars has ordered by the particular customer in that specific invoice.
0
 
LVL 23

Accepted Solution

by:
Ejgil Hedegaard earned 2000 total points
ID: 41894422
0
 

Author Closing Comment

by:Brian Smith
ID: 41894955
Thank you so much Ejgil! it is works like a charm!  :)
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Being an active EE Expert means to get a lot of (E)EMail, as you certainly know. If you are using Outlook, I'll show you how to minimize your inbox contents without losing anything – even improve the experience by changing the Subject line to facili…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question