Home |
Search |
Today's Posts |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks NickHk !
"NickHK" wrote in message ... You could use something like : Public Function GetElement(argInput As Range, Delim As String, Element As Long) As Variant GetElement = Split(argInput.Formula, Delim)(Element - 1) End Function You need to remove the initial "=" and add a check for a Formula and/or Text/Value. But as Tom says, it would easier to start with the data in separate columns and just SUM to get the total, rather than the other way around. NickHK "2007-User" wrote in message ... That is it, thank you so much, is it possible to make it like one of Excel's functions? (like SEPARATOR(A1)) "kounoike" wrote in message ... if using VBA, select all the range you want to change first, then run test1 below. but the range should be in same column.(i assume all formula are in the same column and all oprators are "+") Sub test1() Dim r, s Dim i As Long For Each r In Selection Range(r(1, 2), r.End(xlToRight)).ClearContents s = Split(Mid(r.Formula, 2), "+") For i = 0 To UBound(s) r(1, 2 + i) = s(i) Next Next End Sub keizi "2007-User" wrote in message ... Hi, This is an example of what I am trying to do: In one cell I have "=4+6+12+18+4+5+8+7" (so the result of this cell would be "64"). Now, I would like to have all of these numbers to be sorted and separated in one row (or column) next to each other (like "4","6","12", ... Etc.) how is this possible with or without using VBA? Thanks for your future inputs. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Seperating Text from Numbers in a cell | Excel Worksheet Functions | |||
excel, seperating numbers and text, macro | Excel Discussion (Misc queries) | |||
Seperating numbers from text | Excel Discussion (Misc queries) | |||
Seperating First and Last Names | Excel Discussion (Misc queries) | |||
Seperating Numbers from Letters in Excel | Excel Worksheet Functions |