Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Nate Oliver
 
Posts: n/a
Default Function in XL or in VBA for XL that pulls numeric digits from a t

Hello,

Does XL and/or VBA for XL and/or anyone have any similar function that would
work in XL? If so, I would like to have knowledge of it.


While this thread is somewhat dated, another potential approach is to use a
byte array. E.g.,

Function retNumeric(ByVal myStr As String) As Double
Dim b() As Byte, i As Long, myNum As String
b = StrConv(myStr, vbFromUnicode)
For i = LBound(b) To UBound(b)
Select Case b(i)
Case 46, 48 To 57
myNum = myNum & ChrW$(b(i))
End Select
Next
retNumeric = myNum
End Function

Sub tester()
MsgBox retNumeric("A123B456C789")
End Sub

You can change the ASCII chars and function data type to adjust the parsed
return.

Regards,
Nate Oliver
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Required Numeric RTP Excel Discussion (Misc queries) 5 December 8th 04 08:21 PM
Excel function help facilities RPS Excel Discussion (Misc queries) 1 December 8th 04 02:36 AM
I cant use englisch function names in a swedich version of excel PE Excel Discussion (Misc queries) 2 December 7th 04 01:00 AM
Copy an IF function when Inserting new row Philobr Excel Discussion (Misc queries) 1 December 3rd 04 10:45 AM
Solving for X and Y with a = in the FUNCTION??? TOMSQUAD Excel Discussion (Misc queries) 3 November 29th 04 08:00 PM


All times are GMT +1. The time now is 05:10 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"