+ Reply to Thread
Results 1 to 8 of 8

descriminate string(letters) values from integer/long (number) values

  1. #1
    Forum Contributor
    Join Date
    12-27-2012
    Location
    cebu, Philippines
    MS-Off Ver
    Excel 2016
    Posts
    210

    Red face descriminate string(letters) values from integer/long (number) values

    I need an if statement that can recognize a string (letter/alphabet) values from integer / long (number) values.. Thus if the cell in a column has a number on it, it will flash a msgbox that there's a number...and if the cell contains a string(letters) then it'll do nothing..
    don't worry, there's a lot of people that are far more confused than you
    but if you liked what i suggested. Click for me the "Add Reputation" - that way, we'd be both happy.

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: descriminate string(letters) values from integer/long (number) values

    Hi,

    Not sure what you mean by 'flash a msgbox' since that implies a VBA macro. However why not just use a conditional format in the cell (or column) in question?

    In the 'Use a Formula....' option in conditional formatting just enter the formula
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    and format with a colour as appropriate.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: descriminate string(letters) values from integer/long (number) values

    You can use helper column as:
    Formula: copy to clipboard
    Please Login or Register  to view this content.


    And then Conditional Formatting by that cell

  4. #4
    Forum Contributor
    Join Date
    12-27-2012
    Location
    cebu, Philippines
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: descriminate string(letters) values from integer/long (number) values

    I created a userform where the employees will enter a 6 digit employee number.. Curently, the textbox doesnt recognize if its a letter or a number.. I'm creating an error msgbox if they enter a number.. How do i do that?

  5. #5
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: descriminate string(letters) values from integer/long (number) values

    Try with inputbox:


    Please Login or Register  to view this content.
    You should aslo check is your number 6 digit
    Last edited by zbor; 01-20-2013 at 11:42 AM.

  6. #6
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: descriminate string(letters) values from integer/long (number) values

    If you just want in code use

    Please Login or Register  to view this content.

  7. #7
    Forum Contributor
    Join Date
    12-27-2012
    Location
    cebu, Philippines
    MS-Off Ver
    Excel 2016
    Posts
    210

    Re: descriminate string(letters) values from integer/long (number) values

    thanks zbor,



    this works
    Please Login or Register  to view this content.
    however the above code is a half of what i need, what about another if statement if the input entered on a textbox is a letter? or i mean the counterpart of it?

  8. #8
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    365 ProPlus
    Posts
    15,602

    Re: descriminate string(letters) values from integer/long (number) values

    If it's letter then 1*letter will return error and isnumeric will be false.
    So you need other part of If-Else statement.

    Please Login or Register  to view this content.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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