amandeep08
Board Regular
- Joined
- Mar 20, 2011
- Messages
- 130
- Office Version
- 365
I have a macro that will fetch 10 digit number starting with 501.
I want to change the same so that it can also fetch the 10 digit number starting with 350.
Below is the code:
Sub Get501s()
Dim R As Long, LastRow As Long, XLXS As String, V As Variant, Arr As Variant
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
For R = 1 To LastRow
Arr = Split(Cells(R, "A").Value & " ", 501)
XLXS = ""
For Each V In Arr
If V Like "#######[!0-9]*" Then XLXS = XLXS & ", 501" & Left(V, 7) & ".xlxs"
Next
Cells(R, "A").Value = Mid(XLXS, 3)
Next
End Sub
I want to change the same so that it can also fetch the 10 digit number starting with 350.
Below is the code:
Sub Get501s()
Dim R As Long, LastRow As Long, XLXS As String, V As Variant, Arr As Variant
LastRow = Cells(Rows.Count, "A").End(xlUp).Row
For R = 1 To LastRow
Arr = Split(Cells(R, "A").Value & " ", 501)
XLXS = ""
For Each V In Arr
If V Like "#######[!0-9]*" Then XLXS = XLXS & ", 501" & Left(V, 7) & ".xlxs"
Next
Cells(R, "A").Value = Mid(XLXS, 3)
Next
End Sub