Results 1 to 14 of 14

Two decimal numbers only

Threaded View

  1. #1
    Registered User
    Join Date
    06-28-2022
    Location
    KSA
    MS-Off Ver
    Microsoft Office Professional Plus 2019
    Posts
    54

    Two decimal numbers only

    Hello every one,
    i need to write a code to be as a private sub for a sheets, to have only two decimal numbers if the number has more than two decimal numbers not all numbers
    iam using the following formula:
    Sub bbbb()
     Range("A18:C30").NumberFormat = "0.00"
     Range("D3:D14").NumberFormat = "0.00"
    End Sub
    the problem its converted even the single number which was without decimel ex (25.00) i need it to be as its (25)

    i need the result to be for the only if there is decimal number and the code to work automatic in the sheet like private sub

    thanks for your support,
    Last edited by Mhabashy; 08-21-2024 at 11:03 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Formula of two 2-decimal numbers returns an extended decimal number
    By Matt Triplenichol in forum Excel General
    Replies: 1
    Last Post: 08-09-2022, 05:44 PM
  2. Replies: 1
    Last Post: 05-03-2022, 05:13 AM
  3. [SOLVED] Subtraction of 2 decimal place numbers giving 12 decimal place answer
    By njb212 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 01-22-2018, 09:35 PM
  4. Replies: 4
    Last Post: 12-17-2015, 12:33 AM
  5. Replies: 3
    Last Post: 08-28-2013, 08:45 AM
  6. Replies: 4
    Last Post: 12-26-2012, 05:37 AM
  7. [SOLVED] How can I sort mostly 3 decimal with some 4 decimal numbers
    By PeterM in forum Excel General
    Replies: 4
    Last Post: 08-15-2006, 09:20 PM

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