Consulting

Results 1 to 7 of 7

Thread: Solved: Message box Format??

  1. #1
    VBAX Regular
    Joined
    Nov 2006
    Posts
    81
    Location

    Solved: Message box Format??

    Hi all.
    Could someone help or suggest.....
    The doc. is similar to what I want. The problem that I have is, the display of the answer. I cannot get the display to only show or round the amount to the closest ".00". Even when you format the cells in excel it ,will display the correct amount in the cell but in the box it display's the full amount.

    Any ideas??
    Thanx.

  2. #2
    sorry i had posted an answer but later found it was useless,

    Got me thinking, hope somone replys soon for you

    at present, declaring the variable as an integer will round the number whole
    but to set the decimal places I am ay=t a bit of a loss at the moment.


    cheers
    Last edited by daniel_d_n_r; 07-20-2007 at 06:14 AM.

  3. #3
    VBAX Regular
    Joined
    Nov 2006
    Posts
    81
    Location
    Nope I can't get it intergrated into my code. Thanx

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Either

    [vba]

    Private Sub ComboBox1_Change()
    Range("B5").Value = ComboBox1.Value
    TextBox1.Value = Format(Range("B6"), "#,##0.00")
    End Sub
    [/vba]

    or

    [vba]

    Private Sub ComboBox1_Change()
    Range("B5").Value = ComboBox1.Value
    TextBox1.Value = Range("D6").Text
    End Sub
    [/vba]
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location
    One way:

    In cell E6 =INT(B6*100)
    In Cell D6 =E6/100

    In
    [VBA]Private Sub ComboBox1_Change()
    Range("B5").Value = ComboBox1.Value
    TextBox1.Value = Range("B6")
    End Sub
    [/VBA]
    Change the Range("B6") to "D6"

    Best Regards

    Paul Ked
    Semper in excretia sumus; solum profundum variat.

  6. #6
    VBAX Master paulked's Avatar
    Joined
    Apr 2006
    Posts
    1,007
    Location
    I prefer XLD's
    Semper in excretia sumus; solum profundum variat.

  7. #7
    VBAX Regular
    Joined
    Nov 2006
    Posts
    81
    Location
    Thank you
    That works great.!!!

Posting Permissions

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