for example
![]()
Sub ert() Dim s As String, txt As String s = ActiveCell.Value With CreateObject("VBScript.RegExp") .Pattern = "\$[0-9]+,?[0-9]+" ' .Pattern = "\$\d+,?\d+" If .Test(s) Then txt = .Execute(s)(0) End If MsgBox txt End With End Sub
for example
![]()
Sub ert() Dim s As String, txt As String s = ActiveCell.Value With CreateObject("VBScript.RegExp") .Pattern = "\$[0-9]+,?[0-9]+" ' .Pattern = "\$\d+,?\d+" If .Test(s) Then txt = .Execute(s)(0) End If MsgBox txt End With End Sub
Last edited by nilem; 01-16-2013 at 11:01 AM. Reason: add comment
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks