Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Two decimals

Can anyone pls help me... How do I get two decimals behind the input
and output number in the textboxed in my coding in VBA in th most easy
way possible....? Have tried the Format "0.00" as someone suggested on
the website here, but it did not work and I am not sure I am placing
it in the right spot...

Any suggestions would me welcome!

Thanks
Trine
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 226
Default Two decimals

Hi Trine

I'm not sure what you are trying to do exactly but the code below
might help you with your problem. I set up a userform with two
textboxes and a button to control the code, if a whole number is added
to the first textbox when you click the button it will convert the
number in textbox1 to a double and also add the number as a double in
the second textbox.

Option Explicit

Dim MyNum As Double

Private Sub CommandButton1_Click()

MyNum = TextBox1.Value

TextBox2.Value = Format(MyNum, "0.00")

TextBox1.Value = Format(MyNum, "0.00")

End Sub

I hope this is of some help to you

Steve
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Count digits before decimals and after decimals Elton Law[_2_] Excel Worksheet Functions 5 April 3rd 23 10:59 AM
Decimals, how? LogiMAX Excel Discussion (Misc queries) 6 August 21st 09 11:54 AM
Decimals? Tricia LeAnn[_2_] Excel Discussion (Misc queries) 4 February 4th 08 05:00 PM
Numeric formatting: decimals and no decimals ppsa Excel Programming 4 July 14th 07 09:16 AM
decimals only. joepose Excel Discussion (Misc queries) 5 September 7th 06 01:05 PM


All times are GMT +1. The time now is 04:18 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"