Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am using Regular Expressions to for a replace function. I could not get
the following to work below so I changed the last line by using a Substitute function from Excel. Why isn't the line: 'tempstring = objRegExp.Replace(SeriesAddress, Match(0).Value) working? Public Function RegReplace(Pattern As String, SeriesAddress As String) As String 'Set Reference To Microsoft Scripiting Runtime Dim objRegExp As Object Dim Match Dim tempstring As String Set objRegExp = CreateObject("Vbscript.RegExp") objRegExp.IgnoreCase = IgnoreCase objRegExp.MultiLine = MultiLine objRegExp.Pattern = Pattern Set Match = objRegExp.Execute(SeriesAddress) 'tempstring = objRegExp.Replace(SeriesAddress, Match(0).Value) tempstring = WorksheetFunction.Substitute(SeriesAddress, SeriesAddress, Match(0).Value) RegReplace = tempstring End Function Thanks EM |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Help with a regex pattern please | Excel Programming | |||
Help with a Regex Pattern | Excel Programming | |||
Regex techniques | Excel Programming | |||
RegEx to parse something like this... | Excel Programming | |||
Regex Question | Excel Programming |