+ Reply to Thread
Results 1 to 6 of 6

Format: Using numerals and decimals

  1. #1
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Format: Using numerals and decimals

    When I set my cell for Numbers it wants a decimal place. If I set it to 2 decimals then 100.1 (One hundred point one) would look like 100.10 (and print 100.10). If I use 100.10 (One hundred point ten) it looks and prints 100.10. If I set the decimal to one then the problem is reveresed.

    Setting to General looks like 100.10 (One hundred point ten) but when using VBa to match numbers it is matched to 100.1 not 100.10.

    Now I have it set to Text, but I see when I replace (find & replace) values like find 100 replace 99 the 100.10 becomes 99.1.

    Incedently I have a macro that compares (and copies cell values) numbers from one sheet to another and occasionally it skips a number, always a decimal value like 100.10 or 100.1. Or any thing x.10, x.1, x.3, x.19 any combination of x.x or x.xx.

    Is there a way to format so decimal numbers are decimal numbers and trailing zeros arent omitted? If the value is one decimal I want one decimal, if its two decimals I want two decimals.

    Any hints, tips or examples are appreciated.

    p.s.
    I print tens of thousands of numbers daily, all unnecessary characters that are omitted is saved ink.
    Last edited by Rick_Stanich; 07-13-2009 at 11:12 AM. Reason: Solved
    Regards

    Rick
    Win10, Office 365

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Format: Using numerals and decimals

    Format as General. 100.1 and 100.10 are the same number.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Re: Format: Using numerals and decimals

    Obviously, I cant type as clear as I think.
    I dont want them to be the same.

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Format: Using numerals and decimals

    Then format them as text, and enter only as many decimals as you need. If you're using a lookup and not looking for an exact match, be sure to sort ascending or descending as appropriate.

  5. #5
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885

    Re: Format: Using numerals and decimals

    The only way 100.1 and 100.10 are different is in Text format. If you want to do that, and then use Replace, in the Replace window click Options then check the box for 'Match entire cell contents'.

  6. #6
    Forum Contributor Rick_Stanich's Avatar
    Join Date
    11-21-2005
    Location
    Ladson SC
    MS-Off Ver
    Office365
    Posts
    1,163

    Re: Format: Using numerals and decimals

    I figured out what the problem was and it had nothing to do with what I thought, formatting.

    In my code I had a section like this:
    Please Login or Register  to view this content.
    The code in red was the problem, I was using one too many "If's".
    Now that it reads:
    Please Login or Register  to view this content.
    It no longer skips cells which I originally thought was due to a formatting issue.

    Thanks to those who offered help on the topic.

+ 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