+ Reply to Thread
Results 1 to 2 of 2

Searching multiple text strings/variables

  1. #1
    Registered User
    Join Date
    03-05-2013
    Location
    London
    MS-Off Ver
    Excel 2010
    Posts
    9

    Searching multiple text strings/variables

    In a macro, I have several text strings to which I have assigned variables and I want to search them all to see if:

    1) any of the variables match specific text (e.g "apples and pears") and if so change that variable to alternative text (e.g. "oranges and lemons")

    2) any of them contain an ampersand, and if so to change that to "and"

    Obviously I could add a couple of If statements for each variable, but I presume there is a neat way to search them all at once. I have tried declaring an array and using a loop, but have no experience with this so could not get it to work.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Searching multiple text strings/variables

    Play with this:

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Searching for multiple text strings
    By kschrieb in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-12-2014, 08:38 PM
  2. [SOLVED] Formula for searching multiple text strings
    By Excelcious in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-03-2014, 06:29 PM
  3. Help searching an array of text strings for common strings
    By ABComp in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-23-2012, 11:19 PM
  4. Assigning multiple text strings to variables
    By buggy in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-05-2006, 04:49 PM
  5. searching for multiple text strings
    By eddie in forum Excel General
    Replies: 4
    Last Post: 04-10-2005, 06:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1