Separate String into string + value form
Given I don't know what all possible values are, I will assume that
tree1234 will always have the same length. Given that, you could try
the following
Public Function doParse(Text As String, RowNdx As Integer)
Range("B" & RowNdx) = Left(Text, 4)
Range("C" & RowNdx) = Right(Text, 4)
End Function
Private Sub Workbook_Open()
Dim RowNdx As Integer
Range("A1:A5").Select
With ActiveSheet.UsedRange
For RowNdx = 1 To 5
doParse Range("A" & RowNdx), RowNdx
Next
End With
End Sub
Given the following information in your spreadsheet (cells A1:A5):
tree1234
tree1235
tree1236
tree1237
tree1238
"Johnny" wrote in message ...
If I have a string " tree1234 ". How can I separate it
into 2 cells " tree " and the most important the " 1234 "
should be in value format. Pls advise.
Johnny
|