PDA

View Full Version : parse text



zero80
03-28-2008, 12:33 PM
hi, i need your help

i have this text

1003Sueldo 4,000.00 5010Impuesto a las Ganancias 21.953526Ley 26.341 Vales de Almuerzo 26.44 3527Ley 26.341 Vales Supermercado 28.44 3529Grossing Up - Ley 26.341 11.24 6000Jubilaci?n11 447.276010Ley 190323 121.986030Obra Social Ley 236603 121.98

in A1 cell
i need parse

1003Sueldo 4,000.00 in A2
5010Impuesto a las Ganancias 21.95 in A3
3526Ley 26.341 Vales de Almuerzo 26.44 in A4
3527Ley 26.341 Vales Supermercado 28.44 in A5
3529Grossing Up - Ley 26.341 11.24 in A6
6000Jubilaci?n11 447.27 in A7
6010Ley 190323 121.98 in A8
6030Obra Social Ley 236603 121.98 in A9

thanks

Bob Phillips
03-28-2008, 01:22 PM
What is the rule for the breakpoint?

zero80
03-28-2008, 01:26 PM
the breakpoint is the two decimal

.??

Bob Phillips
03-28-2008, 04:40 PM
Public Sub ProcessData()
Dim i As Long
Dim LastRow As Long
Dim LastPos As Long

With ActiveSheet

LastPos = Len(.Range("A1").Value)
For i = Len(.Range("A1").Value) - 3 To 1 Step -1

If Mid$(.Range("A1").Value, i, 1) = "." Then

.Rows(2).Insert
.Range("A2").Value = Trim(Mid$(.Range("A1").Value, i + 3, LastPos - i - 2))
LastPos = i + 2
End If
Next i
.Range("A1").Value = Left$(.Range("A1").Value, LastPos)
End With

End Sub

zero80
04-01-2008, 06:03 AM
thanks very much!!