seperate number and character in a cell

A

a rohi

ex)
in case A1 = aaa893
B1 = aaa
C1 = 893

in case A2 = 12daa893
B2 = daa
C2 = 12893

how to make function ????

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
B

Bob Phillips

Maybe easiest to write a UDF

Function GetNumeric(rng As Range)
Dim i As Long
Dim sTemp As String

If rng.Count > 1 Then
GetNumeric = CVErr(xlErrRef)
Else
For i = 1 To Len(rng.Value)
If IsNumeric(Mid(rng.Value, i, 1)) Then
sTemp = sTemp & Mid(rng.Value, i, 1)
End If
Next i
GetNumeric = sTemp
End If
End Function


--

HTH

RP
(remove nothere from the email address if mailing direct)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top