From: Project Mangler on 2 Mar 2010 16:39 Thanks Ron, The UDF is a keeper. > As written, this UDF will eliminate everything that is not a letter in the > standard English alphabet; but the pattern can be easily modified. > > ======================================= > Option Explicit > Function GetText(s As String) As String > Dim re As Object > Set re = CreateObject("vbscript.regexp") > re.Pattern = "[^A-Za-z]" 'removes any non-letters > re.Global = True > GetText = re.Replace(s, "") > End Function > ===================================== > --ron
From: Ron Rosenfeld on 2 Mar 2010 17:27 On Tue, 2 Mar 2010 21:39:16 -0000, "Project Mangler" <dblack(a)ntlworld.com> wrote: >Thanks Ron, > >The UDF is a keeper. > > >> As written, this UDF will eliminate everything that is not a letter in the >> standard English alphabet; but the pattern can be easily modified. >> >> ======================================= >> Option Explicit >> Function GetText(s As String) As String >> Dim re As Object >> Set re = CreateObject("vbscript.regexp") >> re.Pattern = "[^A-Za-z]" 'removes any non-letters >> re.Global = True >> GetText = re.Replace(s, "") >> End Function >> ===================================== >> --ron > Glad to help you. Thanks for the feedback. --ron
First
|
Prev
|
Pages: 1 2 Prev: "Undo" creates bizarre behaviour Next: Macro to change pivot field with latest value |