Consulting

Results 1 to 2 of 2

Thread: How to get the numbers from the data

  1. #1

    How to get the numbers from the data

    A field is the data, how to get the results of the C field

    vba12.xlsx

  2. #2
    Try this UDF
    Function AlphaNum(txt As String, Optional numOnly As Boolean = True) As String
        txt = Split(Application.WorksheetFunction.Trim(txt), " ")(1)
        
        With CreateObject("VBScript.RegExp")
            .Pattern = IIf(numOnly = True, "\D+", "-?\d+(\.\d+)?")
            .Global = True
            AlphaNum = Trim(.Replace(txt, ""))
        End With
    End Function
    To use it put this formula in E1 for example then drag
    =VALUE(AlphaNum(A1))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •