Results 1 to 2 of 2

Check one Cell for multiple words in one macro line?

Threaded View

  1. #1
    Registered User
    Join Date
    12-26-2004
    Posts
    5

    Post Check one Cell for multiple words in one macro line?

    Hi guys,

    Probably a simple question for some of you, but I have these lines in my macro:

    If Cells(x, 6) Like "*text1*" Then...
    If Cells(x, 6) Like "*text2*" Then...
    If Cells(x, 6) Like "*text3*" Then... etc etc.

    So for each search criterium I need to add a new 'If..Then..' line. I need like 30 of these lines which makes my program very slow.
    Each cell is being checked if it recognizes one of the 30 words I put in the macro.

    I wish I could make something like:
    If Cells(x, 6) Like "*text1*" OR "*text2*" OR "*text3*"... OR ..."*text30*" Then....

    Is there a construction posible like this?
    So I can put all the words that the cell needs to be checked for are in one singe line? Instead of making a lot of If..Then..'s for each single word?


    Thank you,
    Vernon
    Last edited by Hutas; 01-08-2005 at 10:18 PM.

Thread Information

Users Browsing this Thread

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

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