Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Wildcard with Instr() function 1

Status
Not open for further replies.

2781

Technical User
Feb 26, 2002
21
BE
Is it possible to use a wilcard character, for example the VBA for WORD wildcard ^t to search for a tab.

Instr(1,"MyString",^t)

I tried it in vain, but maybe, there is a way around

Thanks,
 
Use the RegExp object for testing for this and other pattern matching.

HTH
William
Software Engineer
ICQ No. 56047340
 
Thanks for the reply.

Unfortunately, I am still quite new to programming. I have looked for the RegExp object, but I do not seem to find it in Visual Basic or VBA. Is this a VB or VBA object, and if not, how could my problem be solved.

Thanks for the assistance
 
try:

Instr(1,"MyString",vbKeyTab)

or (my favorit)

Instr(1,"MyString",Chr$(9))

instead.

--MiggyD

Never be afraid to try something new. Remember that amateurs built the Ark. Professionals built the Titanic.
 
u can compare strings with Instr Function now u r trying to check special character like tab which i think could be done by
Instr("MyString",Chr$(9)) 'Chr$(9) is the Keycode for TAB key
Regards
Nouman
 
To nomi2000: that's what I posted. I figuered 2781 could use whichever s/he is comfortable with. --MiggyD

Never be afraid to try something new. Remember that amateurs built the Ark. Professionals built the Titanic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top