creating a macro using FIND

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am trying to find a section of text in the title of the file I am opening.
If the FIND function worked in visual basic like it worked in an excel
worksheet I'd be done however that doesn't seem to be the case. Below is
what I tried. Any help on how I can get this to work?

Sub test()
Do
Application.FindFile
M1 = ActiveWorkbook.Name
Loop While Find("stat_output", M1) < 1
End Sub
 
Instr() is the function available in VBA to search inside the text of one string for a particular substring.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top