+ Reply to Thread
Results 1 to 3 of 3

checking for certain words

Hybrid View

  1. #1
    Registered User
    Join Date
    06-15-2009
    Location
    Isle of Man
    MS-Off Ver
    Excel 2003
    Posts
    27

    Question checking for certain words

    The following code will open one of two user forms depending on the value found in the spreadsheet:
    HTML Code: 
    How can I check for either Aardvark, Moose or Zebra using this code?
    If either of these three are there, UF21 should open, otherwise UF8.

    Thanks for your time.
    Last edited by Jockster; 07-23-2010 at 11:23 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: checking for certain words

    Use the select statement

    Select Case UCase(ActiveCell.Offset(, -2).Value)
    Case "ARDVARK", "MOOSE", "ZEBRA"
          UserForm21.Show
    Case Else
        UserForm8.Show
    End Select
    Cheers
    Andy
    www.andypope.info

  3. #3
    Registered User
    Join Date
    06-15-2009
    Location
    Isle of Man
    MS-Off Ver
    Excel 2003
    Posts
    27

    Thumbs up Re: checking for certain words

    Great stuff, thanks

+ Reply to Thread

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