Suppress the 0 in a form
Amazing chart utilities from Jon Peltier
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 6 of 6

Thread: Suppress the 0 in a form

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Location
    Arkansas
    Posts
    358
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    Hi all, I was wondering if there was anyway of not haveing the ( 0 ) on a decimal number. If you type .125 in on a form the next time I view the form it has 0.125, anyway of removing the 0 ? thx Dan

  2. #2
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi dantb

    You haven't said what "the form" is, a Worksheet cell, Textbox, ComboBox etc

    Anyway you can simply use format like

    #.0000

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Location
    Arkansas
    Posts
    358
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Dave, sorry about that, It is a vba Userform and I save the data that is entered for future viewing. Would #.0000 be all I nead in this vba code ?

  4. #4
    Board Regular
    Join Date
    Mar 2002
    Location
    Arkansas
    Posts
    358
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    This is the code I have in the Text box on the form. Would you enter that in the Code ?

    Private Sub TextBox1_AfterUpdate()
    Sheets("BUY - SELL").Range("C8").Value = TextBox1.Text
    End Sub

  5. #5
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi dantb

    If you are saving this to a Worksheet for later viewing then some code like:

    Range("A1").NumberFormat = "#.0000"

    Should work

    If you are going to need this same format in a TextBox you can use something like:

    Dim strNum as string
    strNum =format(range("A1"),"#.0000"






  6. #6
    Board Regular
    Join Date
    Mar 2002
    Location
    Arkansas
    Posts
    358
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Ok Dave thanks again for you help. Just couldnt see how to do it. Thanks again have a good evening. Dan

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com