Solved

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

Posted on 2008-06-19
3
1,111 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Does the idea of dealing with bits scare or confuse you? Does it seem like a waste of time in an age where we all have terabytes of storage? If so, you're missing out on one of the core tools in every professional programmer's toolbox. Learn how to …
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
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…

743 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