-
Get index using RegExp
I've created some code to display selected photographs based on their index number in a report. The way the report is constructed lists the photo refernces within brackets, which may be in any of the following forms. The report is 300+ pages with 5,500 photo references, so a bit of a problem to "regularise".
(X078)
(A078/A079/A080)
(X078, X079)
(AB078 - AB083)
I would like to "extract" the reference number by running the macro when the insertion point is within the reference.
-
A question. If the Selection is in: (AB078 - AB083) , which number would be extracted? All of them?
-
Hi Gerry,
Just the number with the insert. My userform will have Next and Previous buttons to deal with this situation.
-
Sorry Malcolm, it's still not clear :think:
-
Hi Patrick,
Here's a small sample with the userform as WIP. I'm looking to initialise the Userform with the reference containing the insertion point.
-
OK, I've finally got my brain in gear. Much simpler than I was thinking!
[VBA]
Sub Shows()
UserForm2.Show False
UserForm2.TextBox1 = Selection.Words(1)
End Sub
[/VBA]