+ Reply to Thread
Results 1 to 2 of 2

Using part of data for if statement

  1. #1
    Registered User
    Join Date
    07-02-2012
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    38

    Using part of data for if statement

    I want to write an if statement to to open one of two documents based on the data in a cell, but only part of the data.

    For example, data in the cell could be aaorange09, bbapple09, aaround09, bbpear09 etc. The point being that the first two letter are the constant and what I want to use to determine which file to open.

    strCode is where the data is stored.

    If strCode = "first two letters AA" then Open file A
    else
    open file B

    Thank you for your help,
    Matt

  2. #2
    Forum Expert judgeh59's Avatar
    Join Date
    02-07-2013
    Location
    Boise, Idaho
    MS-Off Ver
    Excel 2016
    Posts
    2,310

    Re: Using part of data for if statement

    give this a try - untested

    Please Login or Register  to view this content.
    Ernest

    Please consider adding a * if I helped

    Nothing drives me crazy - I'm always close enough to walk....

+ 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] Part of If statement not working
    By Boo123 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-28-2013, 03:38 PM
  2. What part of this IF statement is working
    By joshnathan in forum Excel General
    Replies: 5
    Last Post: 07-16-2012, 04:29 AM
  3. Using Data Validation as part of an If Statement
    By lelias in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-26-2012, 10:53 AM
  4. IF Then Statement - Part Not Working
    By SEOT in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-01-2009, 04:48 AM
  5. Can a data validation list be used as part of if statement
    By mkmed in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 07-28-2008, 03:01 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