ldarley

Board Regular
Joined
Apr 10, 2012
Messages
90
Hi all,

Is it possible to use multiple substrings with inStr? I want to test if the following characters are contained within mystring /, \, ?, %, *.

Many Thanks
 

Some videos you may like

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.

Rick Rothstein

MrExcel MVP
Joined
Apr 18, 2011
Messages
36,307
Office Version
  1. 2010
Platform
  1. Windows
Is it possible to use multiple substrings with inStr? I want to test if the following characters are contained within mystring /, \, ?, %, *.
Try using the Like operator instead...
Code:
If YourText Like "*[/\?%*]* Then
  MsgBox "YourText contains one of the characters"
End If
 

Watch MrExcel Video

Forum statistics

Threads
1,108,644
Messages
5,524,046
Members
409,557
Latest member
lgambit

This Week's Hot Topics

Top