troubleshooting Question

Only showing numbers in cell

Avatar of andybrooke
andybrooke asked on
Microsoft Excel
7 Comments1 Solution214 ViewsLast Modified:
Hi,

a previous question I wanted only number to be shown from a field this worked great code sample below. I want to expand on this and only show numbers the are more than 3 digits together.

For example I have have a cell like "58     YBS1    QWS/ENQ/1501510 BGC". From this I would only want 1501510 to show....

Thanks
Option Explicit

Function RemoveAlpha(Rng As String) As String
    Dim Tmp As String
    Dim i As Integer
    Dim Alpha As String
    
    Tmp = Rng
    'Numbers are 48-57
    For i = 1 To 255
        If i >= 48 And i <= 57 Then GoTo skip
        Alpha = Chr(i)
        Tmp = Application.Substitute(Tmp, Alpha, "")
skip:
    Next i
    RemoveAlpha = Tmp
End Function
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 7 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 7 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros