Results 1 to 13 of 13

How to Trim a string

Threaded View

  1. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: How to Trim a string

    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

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1