Nagesh:
try,
Sub test()
Dim a As Variant
a = VBASplit(Range("A1"), " ")
For IDX = 1 To UBound(a)
Cells(IDX + 1, 1) = a(IDX)
Next
End Sub
Public Function VBASplit(InputText As String, Delimiter As String) As Variant
Const CHARS = ".!?,;:""'()[]{}"
Dim strReplacedText As String
Dim intIndex As Integer
strReplacedText = Trim(Replace(InputText, vbTab, " "))
For intIndex = 1 To Len(CHARS)
strReplacedText = Trim(Replace(strReplacedText, _
Mid(CHARS, intIndex, 1), " "))
Next intIndex
Do While InStr(strReplacedText, " ")
strReplacedText = Replace(strReplacedText, _
" ", " ")
Loop
If Len(Delimiter) = 0 Then
VBASplit = VBA.Split(strReplacedText)
Else
VBASplit = VBA.Split(strReplacedText, Delimiter)
End If
End Function
--
天行å¥ï¼Œå›å以自強ä¸æ¯
地勢å¤ï¼Œå›å以厚德載物
http://www.vba.com.tw/plog/
Nagesh said:
I have a value say @Sum([aa] [bb] [cc] [dd] [ee]) in cell A1.
I want to place the cursor in cell A2 and run a function which will remove
the brackets and place the values in cells as follows:
A2- aa
A3- bb
A4- cc
A5- dd
A6- ee
Thanks, Nagesh