+ Reply to Thread
Results 1 to 3 of 3

VBA InStr OR

  1. #1
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    VBA InStr OR

    Hi, I wonder whether someone may be able to help me please

    I'm using the line of code below to extract certain pieces information using the 'InStr' function.

    Please Login or Register  to view this content.
    This part of the code is working fine:
    Please Login or Register  to view this content.
    But I'm having some difficulty in getting the second part of the line working i.e
    Please Login or Register  to view this content.
    What I'm trying to say is if .offset(i, 3) = "C&R Principal Practitioner" OR .offset(i, 3) = "C&R Senior Analyst" OR .offset(i, 3) = "C&R Analyst" And PDate = CMonth And AFTE > 0 Then but the results returned are only for the first value.

    I just wondered whether someone may be able to look at this please and offer some guidance on how I may go about making the changes so that it is an 'Or' statement and the whole cell has to match these values rather than just 'InStr'.

    Many thanks and kind regards

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

    Re: VBA InStr OR

    Maybe

    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    05-26-2012
    Location
    United Kingdom
    MS-Off Ver
    Excel 2013
    Posts
    682

    Re: VBA InStr OR

    Hi @mrice, thank you very much for taking the time to reply to my post and for the solution. It's exactly what I was after and works great.

    All the best and kind regards

+ 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. Instr() function
    By Lifeseeker in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-20-2011, 03:57 PM
  2. InStr Question
    By PY_ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-09-2010, 09:47 AM
  3. [SOLVED] InStr Question
    By Norm Lundquist in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-16-2006, 01:15 PM
  4. [SOLVED] InStr
    By Harley in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-09-2005, 04:05 PM
  5. InStr
    By FGM in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-14-2005, 04:05 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