+ Reply to Thread
Results 1 to 2 of 2

Check if a cell value is a number and convert to string

  1. #1
    Forum Contributor
    Join Date
    03-02-2014
    Location
    usa
    MS-Off Ver
    MS 365
    Posts
    593

    Check if a cell value is a number and convert to string

    Hello,
    I am trying to have a script which checks the content of a cell (say A1); If the content of the cell is a number (it could be negative, positive, integer, decimal), than convert the cell value into a text.

    Could you please advise?
    Thanks

  2. #2
    Forum Guru
    Join Date
    04-13-2005
    Location
    North America
    MS-Off Ver
    2002/XP and 2007
    Posts
    15,811

    Re: Check if a cell value is a number and convert to string

    The ISNUMBER() function will tell if a cell is a number. ISTEXT() can tell if a cell is text (including numbers stored as text). The TEXT() function can convert a number to a text string in a specified number format.

    IS... functions: https://support.microsoft.com/en-us/...1-f2d869135665
    TEXT function: https://support.microsoft.com/en-us/...8-93d29371225c
    Number format codes: https://support.microsoft.com/en-us/...7-9c9354dd99f5
    Quote Originally Posted by shg
    Mathematics is the native language of the natural world. Just trying to become literate.

+ 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. Replies: 2
    Last Post: 01-05-2018, 12:31 AM
  2. [SOLVED] Convert custom number format to string or cell's displayed value
    By keineko in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-17-2017, 06:11 PM
  3. Replies: 7
    Last Post: 04-15-2015, 09:32 AM
  4. Should i convert string to number before comparing against a number or leave as is
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-06-2015, 12:04 PM
  5. Replies: 2
    Last Post: 12-12-2012, 04:19 AM
  6. Replies: 1
    Last Post: 01-25-2010, 12:48 PM
  7. Check if string contains a number
    By mkvassh in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-25-2009, 08:45 AM

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