Hi,
I'm working on a program that I want to recognize if a cell contains any number in it by leveraging a RegEx. Currently it isn't working and only returns text when the cell has numbers and text. In the cell I have "55112 5 mile radius" & the cell format is listed as general. Would love any insight here....
I'm working on a program that I want to recognize if a cell contains any number in it by leveraging a RegEx. Currently it isn't working and only returns text when the cell has numbers and text. In the cell I have "55112 5 mile radius" & the cell format is listed as general. Would love any insight here....
VBA Code:
Option Explicit
Sub workarea()
Dim RegNew As RegExp
Set RegNew = New RegExp
With RegNew
.Pattern = "([^0-9])"
.Global = False
.IgnoreCase = True
End With
If RegNew.Test(ActiveWorkbook.ActiveSheet.Cells(3, 4)) = True Then
Debug.Print "no numbers in the file"
Else
Debug.Print "numbers found"
End If
End Sub