+ Reply to Thread
Results 1 to 8 of 8

How to set alphanumeric condition in my if statement?

  1. #1
    Registered User
    Join Date
    04-04-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    29

    Post How to set alphanumeric condition in my if statement?

    The code below adds 6,8 weeks and 18,24 months to userinput Date1a based on its location like TDS( Tear Down station) & storage shelf(SS) and change colors after the product passes the date thresholds. Currently it is accepting only strings("TDS", "SS") at if and elseIf conditions, and I would like to do the same process with TDS1,TDS2, SS34, SS45... and so on. So that it is more general. I tried doing

    Please Login or Register  to view this content.
    along with Asc case 48 to 57 ( for 0-9). Unfortunately, both of them has not worked. Can anyone please take a look at it and let me know on how to solve this problem

    Please Login or Register  to view this content.
    Thanks,
    excelkann
    Last edited by excelkann; 04-10-2016 at 02:42 AM.

  2. #2
    Forum Contributor
    Join Date
    01-08-2016
    Location
    Cagayan De Oro City, Philippines
    MS-Off Ver
    2013
    Posts
    152

    Re: How to set alphanumeric condition in my if statement?

    Hi

    its a little unclear as to your goal or purpose for the textbox, im guessing your using this to do other things apart from what you posted here.....

    if it doesnt matter what the number is as long as the TDR or SS part is in the text then you could try using LIKE as the condition, its a simplified regex function.......LINK

    so in your case you might have something like this

    Please Login or Register  to view this content.
    this will match any text starting with TDS

  3. #3
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: How to set alphanumeric condition in my if statement?

    Delete.......................
    Last edited by jindon; 04-10-2016 at 11:16 AM.

  4. #4
    Forum Contributor
    Join Date
    01-08-2016
    Location
    Cagayan De Oro City, Philippines
    MS-Off Ver
    2013
    Posts
    152

    Re: How to set alphanumeric condition in my if statement?

    This would work but not for anything with more than 1 digit after the text

    building on both Jindon's advice and my own it is probably better to do

    Please Login or Register  to view this content.
    this would allow "TDSR01" to be seperated from "TDS01" for example but allow any number of characters after the first number assuming your using logic like [Name][IndexNumber] for the text here

  5. #5
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,524

    Re: How to set alphanumeric condition in my if statement?

    No idea about what he is asking.
    Last edited by jindon; 04-10-2016 at 11:15 AM.

  6. #6
    Registered User
    Join Date
    04-04-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    29

    Re: How to set alphanumeric condition in my if statement?

    Sample1.jpg



    Please Login or Register  to view this content.
    I am seeing some 1900 dates for my triggers as seen in the picture .For TDS1 input, this code is expected to take userinput for column E and add 6 weeks and store it in column F. Similarly, add 8 weeks and store it in column G. For SS1 input, this code is expected to take userinput from column E and add 18months and store it in column F and add 24 months and store in column F.

    As seen in the picture, for row 2 (TDS1) I am seeing some 1900 dates and for row 3 (SS1) I am not seeing any dates for my triggers. Can anyone please spot any errors in my code or syntax.

    Thanks,
    excelkann

  7. #7
    Registered User
    Join Date
    04-04-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    29

    Re: How to set alphanumeric condition in my if statement?

    @ jindon- if you need any clarifications about my question, code or picture. Please ask. I will try to clarify it.

    Thanks,
    excelkann

  8. #8
    Registered User
    Join Date
    04-04-2016
    Location
    USA
    MS-Off Ver
    2010
    Posts
    29

    Re: How to set alphanumeric condition in my if statement?

    Moving to combobox instead of a textbox has solved the problem. It was more like a work around.But, it works for me.

    Please Login or Register  to view this content.
    - this statement helped me. So Thank you @ jindon and @gbeats101

    Regards,
    Excelkann

+ 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. if statement with and condition
    By gasniger in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 01-24-2015, 08:54 PM
  2. [SOLVED] 23 condition IF statement possible?
    By fayjohn123 in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 05-23-2013, 04:43 PM
  3. Applying a VLOOKUP using an Alphanumeric Value search condition
    By JeffNYG23 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-16-2013, 02:33 PM
  4. if statement with condition
    By jw01 in forum Excel General
    Replies: 3
    Last Post: 11-27-2010, 01:08 AM
  5. IF statement more than one condition
    By Gambinus in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 03-19-2007, 01:43 PM
  6. Condition:If Statement
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-20-2006, 04:00 AM
  7. Condition Statement
    By Django in forum Excel General
    Replies: 5
    Last Post: 08-26-2005, 02:05 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