Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
RegEx in VBE code editor
Is there any addin which would enable this capability? I so often find
myself in positions where a regex would do just the trick. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
RegEx in VBE code editor
Hi
as an example (validation of email addresses): Public Function ValidateEmail(MailAddress As String) As Boolean Dim oRegExp As Object Set oRegExp = CreateObject("VBScript.RegExp") With oRegExp .Pattern = "^\w+((-\w+)|(\.\w+))*\@\w+((\.|-) \w+) *\.\w+$" ValidateEmail = .Test(MailAddress) End With End Function -- Regards Frank Kabel Frankfurt, Germany "R Avery" schrieb im Newsbeitrag ... Is there any addin which would enable this capability? I so often find myself in positions where a regex would do just the trick. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
RegEx in VBE code editor
http://msdn.microsoft.com/library/de...ting051099.asp
Can be called from VBA. -- Regards, Tom Ogilvy "R Avery" wrote in message ... Is there any addin which would enable this capability? I so often find myself in positions where a regex would do just the trick. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
RegEx in VBE code editor
I'm sorry, I was not clear enough. I am familiar with using RegEx in VB
functions, but the VBE Search and Replace form supports wildcards, but not RegEx. Is there a VBE Extensibility addin that enables RegEx search and replace in the code editor. Typical examples would be: I have a function with like 50 lines of var1 = cells(1,1).value, var2 = cells(2,1).value, etc, and I would like to reverse the equality so that it instead reads cells(1,1).value = var1, cells(2,1).value = var2. As far as i know, things like this cannot be done using wildcards. Tom Ogilvy wrote: http://msdn.microsoft.com/library/de...ting051099.asp Can be called from VBA. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
RegEx in VBE code editor
I think you would need to export it to a text editor like Textpad and do it
there. -- HTH RP (remove nothere from the email address if mailing direct) "R Avery" wrote in message ... I'm sorry, I was not clear enough. I am familiar with using RegEx in VB functions, but the VBE Search and Replace form supports wildcards, but not RegEx. Is there a VBE Extensibility addin that enables RegEx search and replace in the code editor. Typical examples would be: I have a function with like 50 lines of var1 = cells(1,1).value, var2 = cells(2,1).value, etc, and I would like to reverse the equality so that it instead reads cells(1,1).value = var1, cells(2,1).value = var2. As far as i know, things like this cannot be done using wildcards. Tom Ogilvy wrote: http://msdn.microsoft.com/library/de...ting051099.asp Can be called from VBA. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
RegEx in VBE code editor
I also missed RegEx sometimes.
Maybe Perl could be a solution when a workaround in VBA seems to be too tedious: http://support.microsoft.com/default.aspx?scid=kb;EN- US;214797 Regards, Bernd |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
RegEx in VBE code editor
Sorry, didn't read the subject - just the text.
-- Regards, Tom Ogilvy "R Avery" wrote in message ... I'm sorry, I was not clear enough. I am familiar with using RegEx in VB functions, but the VBE Search and Replace form supports wildcards, but not RegEx. Is there a VBE Extensibility addin that enables RegEx search and replace in the code editor. Typical examples would be: I have a function with like 50 lines of var1 = cells(1,1).value, var2 = cells(2,1).value, etc, and I would like to reverse the equality so that it instead reads cells(1,1).value = var1, cells(2,1).value = var2. As far as i know, things like this cannot be done using wildcards. Tom Ogilvy wrote: http://msdn.microsoft.com/library/de...ting051099.asp Can be called from VBA. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Protecting Code in Visual Basic Editor (Excel 2003) | Excel Worksheet Functions | |||
Closing the VBA Editor using code | Excel Worksheet Functions | |||
In Excel VBA Editor, how do I hide my code from other users? | Excel Discussion (Misc queries) | |||
printing module code from vba editor | Excel Programming | |||
Regex Question | Excel Programming |