i have cell with formulas like this "2+5-7" and i want to have a separate
cell for each number. i have tried using the Cntl ~ function which displays
the formulas but you can't use functions like @left when the cell is in that
state. any ideas? thanks in advance for your help
You need to use VBA.
Here's one example:
To enter this Macro (Sub), <alt-F11> opens the Visual Basic Editor.
Ensure your project is highlighted in the Project Explorer window.
Then, from the top menu, select Insert/Module and
paste the code below into the window that opens.
To use this Macro (Sub), Select the range to process. Then <alt-F8> opens the
macro dialog box. Select the macro by name, and <RUN>.
=================================
Option Explicit
Sub SplitNums()
Dim rg As Range, c As Range
Dim S As String
Dim i As Long
Set rg = Selection 'or whatever
Dim re As Object, mc As Object, m As Object
Set re = CreateObject("vbscript.regexp")
re.Global = True
re.Pattern = "\b\d*\.?\d+\b"
For Each c In rg
Range(c.Offset(0, 1), c.Offset(0, 10)).Clear
S = c.Formula
If re.test(S) = True Then
Set mc = re.Execute(S)
i = 1
For Each m In mc
c.Offset(0, i).Value = m.Value
i = i + 1
Next m
End If
Next c
End Sub
=================================
--ron