Home |
Search |
Today's Posts |
#11
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Here's my attempt at finding the two cell addresses.
There's not a lot of logic here. It just looks at the characters following the "!" Character. There may be a better technique. I shortened the string a little. Returns: Found: 2 $U$77 $U$85 Sub Demo() '// = = = = = = = = = = '// Microsoft VbScript Regular Expressions 5.5 '// = = = = = = = = = = Dim Re As RegExp Dim MyEquation As String Dim AllPositions As MatchCollection Dim Position As Match '// Looking for a cell Address: Const LookFor As String = "![$ 0-9 A-Z]+" MyEquation = "'P:\[Book.xls]Allo'!$U$77*10-'P:\DMB\[Book.xls]Allo'!$U$85" Set Re = New RegExp Re.Pattern = LookFor Re.IgnoreCase = True Re.Global = True If Not Re.Test(MyEquation) Then Exit Sub Set AllPositions = Re.Execute(MyEquation) Debug.Print "Found: " & AllPositions.Count For Each Position In AllPositions ' 0-Indexed Debug.Print Mid$(Position.Value, 2) Next Position End Sub -- HTH :) Dana DeLouis Windows XP & Office 2007 <snip |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Use InStr function in formula? | Excel Worksheet Functions | |||
is there an equal fxn for 'InStr' in excel. Not Find or Search | Excel Worksheet Functions | |||
Where is the Instr() function in Excel 2003? | Excel Discussion (Misc queries) | |||
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) | Excel Worksheet Functions | |||
Emulate Index/Match combo function w/ VBA custom function | Excel Worksheet Functions |