Solved

How can I check if a String contains another String using VBA 6.0?

Posted on 2008-06-19
3
1,114 Views
Last Modified: 2010-08-05
How can I do a check to see if String 'x' contains String 'y' anywhere within using VBA 6.0?
0
Comment
Question by:MaineBiotech
  • 2
3 Comments
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 50 total points
ID: 21822864
If InStr(1, StringX, StringY) > 0 Then
    'contains
Else
    'does not contain
End If
0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 21822885
MaineBiotech,

The 1 is not fixed; use it to force what position to start the search at.  There is also an optional argument
for which text comparison mode to use.  See the help file for more details.

Regards,

Patrick
0
 

Author Closing Comment

by:MaineBiotech
ID: 31468819
Perfect, thank you very much!
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is about my first experience with programming Arduino.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now