spliting data in a cell
Hi Matt, I tried rons formula but i got a circular reference error. I was
probably putting it in the wrong cell.
I tried the text to columns and that worked a treat.
many thanks
"matt" wrote:
On Mar 12, 9:06 am, Maax wrote:
Hello all, i have a cell that has a partnumber in it and a revision
number. As in "1234567/A". The part number and issue can be in any format and
any length(numbers or letters in any order). There is always a "/" to
seperate the part number from the revision. I require a formula/code that
will copy the part number prior to the "/" in to a cell and also i require
the revision after the "/" to another cell.
Any help would be appreciated.
many thanks
In Excel, there are a few ways that you can do this. I'll mention two
ways to do it in Excel and then one function in VBA that will do it as
well.
"Text to Columns" (Menu Bar: Data/Text to Columns/Delimited/Other:
"/").
You could also do a =SEARCH() to find the place where "/" is located.
Then use that placement number in a =LEFT to return whatever is to the
left of the "/" (i.e. LEFT(string, # returned by SEARCH - 1)) and then
use a =RIGHT(string, LEN(string) - # returned by SEARCH). option will
do what you are looking for.
In VBA the delimit function is SPLIT, so you could do something like
this:
myLeft = split(string, "/")(0)
myRight = split(string, "/")(1)
Hopefully this helps.
Matt
|