PDA

View Full Version : Solved: Help with formula to divide number into 4 cells



Barryj
04-23-2011, 12:03 PM
I have a number that is pasted in a column and then I need to divide it up into 4 seperate cells for further processing, can anyone suggest a formula to extract the required sections from cell B in the File.

If possible I need it to read from the left as there is a possibility that there maybe text at the end which I would assume would throw out a formula the would read from the right.

Thanks for any assistance.

p45cal
04-23-2011, 12:36 PM
Text to Columns, using spaces as the delimiter.
Also see attachment which has two other solutns, one with built-in formulae, and another with a user defined function.

The code for the user dfined function is:Function SplitIt(theString, Delimiter, InstanceNo)
SplitIt = Split(theString, Delimiter)(InstanceNo - 1)
End Function

Barryj
04-23-2011, 01:20 PM
p45cal thanks for the help, the code you provided, how is that triggered, does it require to be put into a macros?

p45cal
04-23-2011, 01:32 PM
It's in the attached file in a vba code module (yes, macro). It's triggered by using it as a normal formula in a worksheet, as shown.

Barryj
04-25-2011, 05:47 AM
Thank you p45cal the split function seems to be the best solution for what I need, thnkyou again, I will mark this as solved.