+ Reply to Thread
Results 1 to 7 of 7

need help with if or and mid statement

  1. #1
    Registered User
    Join Date
    09-19-2014
    Location
    goa,india
    MS-Off Ver
    MS excel 2007
    Posts
    24

    need help with if or and mid statement

    i have some strings in coloumn B2...it is all constant or all cells till the 17th character of the string after which there are codes like FI,WM,MM,CO..etc
    i want to check with these codes and give a common code eg
    if it is FI or CO then show FICO if it is MM or PUR or show MM etc i have used this code

    Please Login or Register  to view this content.
    but am getting only S&A

    it mayb a syntax error plz help
    Last edited by erickmcburger; 09-19-2014 at 11:30 PM. Reason: code change

  2. #2
    Valued Forum Contributor
    Join Date
    12-14-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2007
    Posts
    439

    Re: need help with if or and mid statement

    Excel can not understand "B2" in your code. Try replace all B2 in your code by Cells(i,2).Value

  3. #3
    Forum Contributor pareshj's Avatar
    Join Date
    05-20-2014
    Location
    MUMBAI
    MS-Off Ver
    2007 & 2010
    Posts
    447

    Re: need help with if or and mid statement

    Hi,

    Please check the forum rules :
    http://www.excelforum.com/forum-rule...rum-rules.html

    Use Code tags around the code.


    Regards,
    Paresh J
    Click on "* Add Reputation" as a way to say thanks

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Lightbulb Re: need help with if or and mid statement


    Easier with Select Case statement instead of several If

  5. #5
    Registered User
    Join Date
    09-19-2014
    Location
    goa,india
    MS-Off Ver
    MS excel 2007
    Posts
    24

    Re: need help with if or and mid statement

    thanks a lot it worked

  6. #6
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: need help with if or and mid statement

    Try:

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    09-19-2014
    Location
    goa,india
    MS-Off Ver
    MS excel 2007
    Posts
    24

    Re: need help with if or and mid statement

    to find a word "NOT" in the 5th cell and to post if found in the 14th cell "Not" else post the values of the 13th cell. this has to check and post for 500 cells
    i am getting error in the code for search string

+ 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. compile error expected line number statement end statement
    By mattress58 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-18-2014, 10:12 AM
  2. VBA Compile Error : line number or label or statement or end of statement
    By excellearner121 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-04-2013, 06:41 PM
  3. Replies: 4
    Last Post: 06-01-2012, 10:05 AM
  4. Replies: 4
    Last Post: 05-16-2012, 05:33 PM
  5. [SOLVED] Utilize a Select Case Statement in Target Intersect Statement
    By max57 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-29-2009, 08:55 PM

Tags for this Thread

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