String to be split
On 15 dic, 08:07, yagna wrote:
Hi,
I have the string in the Excel file where the *
"\abc*aa**11111_aa*125.00*125.00*0.0\ " I need to split this data from the
long string stored in the cell. Sometime the above marked string is broken to
next row. how do I split this in macro & to find out when it is split in the
different but continuous row.
Split required are
Col A -111111_aa
Col B -125.00
col C-125.00
Col D-0.00
Thanks & regards,
yagna.
Hello.
This macro can help you:
Sub split()
textstring = "\abc*aa**11111_aa*125.00*125.00*0.0\ "
a = split(Replace(textstring, "\", ""), "*")
For cont = LBound(a) To UBound(a)
On Error Resume Next
If IsNumeric(Left(a(cont), 1)) Then
desr = desr + 1
With ActiveCell.Offset(desr, 0)
.NumberFormat = "@"
.Value = a(cont)
End With
End If
Next
End Sub
Regards,
Benito
Barcelona
|