Extract Numbers using Excel VBA

preview_player
Показать описание

Рекомендации по теме
Комментарии
Автор

This is exactly what I have been searching for for sometime, either on YouTube or in Google in general. Thanks a lot for saving my nerves! :)

MrPorqpine
Автор

Thanks buddy I have made some modifications on it and used to sum the values In between {} arrays🎉🎉🎉

majapamajapa
Автор

Obviously late to the party. This exactly what I spent 4 hours today trying to figure out on my own. Thank you sir!

itsnotthatsimple
Автор

Very good topic taken. But it would have been much better if the code was written and explained line by line because its somewhat hard for beginners to understand. But anyways thanks for the video.

sktneer
Автор

Thank you for your great tutorial, i've learned from it even short period of time, but i do have a question please. I'm working on a report that has alphanumeric on it and I only need to retrieve 7 integers that starts with 7 and 3 example

SCM RIS PX RIS 02 - 7152349, ADSF\243434134, CM532345 and i need to get the 7152349. Can you please help me on this?

I truly appreciate your help!

yami
Автор

I found this VBA Code Excellent. This code is not working if the Text is Right side of Numbers e.g If data is 13, 54S.S.G this is not working . This code works for Data S.S.G13.54 giving value as 13.54

s.s.ganpule
Автор

compile error:
Sub or Function not defined how to solve ??

' all the functions would go here.
Public Function getNumber2(fromThis As Range) As Double
    'this function extracts the number from a given cell - fromThis
    Dim retval As String
    Dim i As Integer
    
    retval = ""
    For i = 1 To Len(fromThis)
        If IsNumeric(Mid(fromThis, i, 1)) Then
            retval = retval & Mid(fromThis, i, 1)
        End If
    Next i
        
    getNumber2 = CDB1(retval)
            
End Function

mngshb
Автор

I have used this function befoe

Public Function SplitTex(pWorkRng As Range, pIsNumber As Boolean) As String
Dim xLen As Long
Dim xStr As String
xLen = VBA.Len(pWorkRng.Value)
For i = 1 To xLen
xStr = VBA.Mid(pWorkRng.Value, i, 1)
If ((VBA.IsNumeric(xStr) And pIsNumber) Or (Not (VBA.IsNumeric(xStr)) And Not (pIsNumber))) Then
SplitText = SplitText + xStr
End If
Next
End Function

Sub Split()

End Sub

Ahmedsaleh-ljnf
welcome to shbcf.ru