View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.newusers
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Stripping digits from a column

If yu have a set of mixed numbers and letters and want only the nine-most
numbers, then:

=RIGHT(returnnumerals(A2),9)

where the UDF is:


Public Function ReturnNumerals(rng As Range) As String
Dim sStr As String, i As Long, sStr1 As String
Dim sChar As String
sStr = rng.Value
For i = 1 To Len(sStr)
sChar = Mid(sStr, i, 1)
If sChar Like "[0-9]" Then
sStr1 = sStr1 & sChar
End If
Next
ReturnNumerals = sStr1
End Function
--
Gary''s Student - gsnu200770


"BernieG" wrote:

Assuming the text is in cell A1, type =RIGHT(A1,9)

If this doesn't work, the text may contain non-printing characters. If so,
type
=RIGHT(CLEAN(C9),9)

Hope this helps.

--
BernieG


"Mike" wrote:

Hi,
I've a column containing alphanumeric text as 200731705A832565410B12345678.
Out of this text, I need only the 9 right most digits.
How do I go by?
TIA,
Mark