Closed Thread
Results 1 to 4 of 4

Thread: some numbers formatted as text

  1. #1
    Registered User
    Join Date
    07-12-2010
    Location
    southampton uk
    MS-Off Ver
    Excel 2007
    Posts
    6

    some numbers formatted as text

    I have had a problem with some data not appearing to be what I thought it was. A column that appeared to be all numbers contained some text fields.

    I'd been looking for a solution and with the help of members (of another forum) I think I now have a solution.

    If I have a character 1 in a cell - then that cell is 1 character long and has the ASCII code 49 but when I apply isnumeric then I may get TRUE for some cells and FALSE for other cells.

    Not having control of the data source I wanted to be able to validate the data - prior to use.
    So simple but just select the range then multiply the source by 1 and replace

    Private Sub CommandButton2_Click()
    Set myRng = Sheets(ActiveSheet.Name).Range("A29:C34")
    For Each rngCell In myRng
    rngCell.Value = rngCell.Value * 1
    Next rngCell
    End Sub

  2. #2
    Forum Guru Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,276

    Re: some numbers formatted as text

    Hi peterhw and welcome to the forum.

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Please leave a message after the beep!

  3. #3
    Registered User
    Join Date
    07-12-2010
    Location
    southampton uk
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: some numbers formatted as text

    Quote Originally Posted by Mordred View Post
    Hi peterhw and welcome to the forum.

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    My apologies. Have tried again but still struggling. (the formatting appears to change very little!)

  4. #4
    Forum Moderator Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2007
    Posts
    5,953

    Re: some numbers formatted as text

    New thread started, and apparently resolved, here: http://www.excelforum.com/excel-prog...d-as-text.html

    This thread is closed.

Closed Thread

Thread Information

Users Browsing this Thread

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

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.2.0