![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Board Regular
Join Date: Mar 2002
Location: Arkansas
Posts: 358
|
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 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
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 |
|
Board Regular
Join Date: Mar 2002
Location: Arkansas
Posts: 358
|
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 |
|
Board Regular
Join Date: Mar 2002
Location: Arkansas
Posts: 358
|
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 |
|
Banned
Join Date: Feb 2002
Posts: 1,582
|
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 |
|
Board Regular
Join Date: Mar 2002
Location: Arkansas
Posts: 358
|
Ok Dave thanks again for you help. Just couldnt see how to do it. Thanks again have a good evening. Dan
|
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|