+ Reply to Thread
Results 1 to 6 of 6

If Cell Contains "Value" or "Value" or "Value" Then 'run code Else 'run other code

  1. #1
    Valued Forum Contributor unit285's Avatar
    Join Date
    10-29-2015
    Location
    TN
    MS-Off Ver
    Office 365
    Posts
    358

    If Cell Contains "Value" or "Value" or "Value" Then 'run code Else 'run other code

    Please Login or Register  to view this content.
    Can anyone tell me why this code is not working? As it's written it applies "st" regardless of what Find285.Offset(0, 10).Value is.
    Thanks!

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: If Cell Contains "Value" or "Value" or "Value" Then 'run code Else 'run other code

    You have numbers represented as strings. Does it help if you remove the double quotes?

  3. #3
    Valued Forum Contributor unit285's Avatar
    Join Date
    10-29-2015
    Location
    TN
    MS-Off Ver
    Office 365
    Posts
    358

    Re: If Cell Contains "Value" or "Value" or "Value" Then 'run code Else 'run other code

    Just tried it and it does not make any difference

  4. #4
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: If Cell Contains "Value" or "Value" or "Value" Then 'run code Else 'run other code

    What is Find285? I have never heard of that.
    Edit- Oops, that must be a named range I suppose
    Last edited by sourabhg98; 01-30-2016 at 01:39 PM.
    Happy to Help

    How to upload excel workbooks at this forum - http://www.excelforum.com/the-water-...his-forum.html

    "I don't get things easily, so please be precise and elaborate"

    If someone's post has helped you, thank by clicking on "Add Reputation" below the post.
    If your query is resolved please mark the thread as "Solved" from the "Thread Tools" above.

    Sourabh

  5. #5
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: If Cell Contains "Value" or "Value" or "Value" Then 'run code Else 'run other code

    Spotted the error.
    It must be like
    Please Login or Register  to view this content.
    After every "OR" there must be an equation.
    It should not be like
    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor unit285's Avatar
    Join Date
    10-29-2015
    Location
    TN
    MS-Off Ver
    Office 365
    Posts
    358

    Re: If Cell Contains "Value" or "Value" or "Value" Then 'run code Else 'run other code

    Quote Originally Posted by sourabhg98 View Post
    Spotted the error.
    It must be like
    Please Login or Register  to view this content.
    After every "OR" there must be an equation.
    It should not be like
    Please Login or Register  to view this content.
    This was the problem. It now works perfectly! Thanks!

+ 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. Replies: 1
    Last Post: 08-15-2014, 06:00 AM
  2. Replies: 4
    Last Post: 11-17-2013, 12:05 PM
  3. [SOLVED] How to USE """"" cells count """"" change font color
    By austin123456 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2013, 06:14 AM
  4. Replies: 0
    Last Post: 11-20-2012, 10:22 AM
  5. Replies: 5
    Last Post: 10-12-2010, 06:46 AM
  6. Replies: 5
    Last Post: 06-26-2006, 09:23 PM
  7. Replies: 7
    Last Post: 05-13-2006, 05:02 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