I have a table in Excel and one of its columns contains string of the type: 125j, 0j, 12j, etc.
I want the value of the cells (in this column) to be replace by the numbers (i.e. I want to drop the "j") using the VBA. Here is what I have:
Dim reg As Object
Set reg = CreateObject("VBScript.RegExp")
reg.IgnoreCase = True
reg.Pattern = "^[0-9]+"
If reg.test(Cells(i, 4).Value) Then
Cells(i, 4).Value = reg.Execute(Cells(i, 4).Value)
End If
But it doesn't work, do anyone knows either how to crrect it or to obtain the same result from another command?
Thank you