[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.excel.programming

Re: VB number formats

Gary Keramidas

12/11/2006 9:17:00 PM

you could try this, as long as there is a command button or somewhere to go
after the last textbox entry

Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
Me.TextBox1 = Format(Me.TextBox1.Value, "$#,###,###.00")
End Sub


--


Gary


"timmulla" <timmulla@discussions.microsoft.com> wrote in message
news:FE54A0AB-8EAC-42E1-9598-37BEAD82C11F@microsoft.com...
> Can somebody please help me with some VB number formats?
>
> I have a textbox on a form that users manually input a percent. Is there a
> way to set the number format to a percent through VB code? Currently, the
> user needs to manually add the percent sign to the number they are inputing.
> I would like the percent sign to automatically default to the numbers inputed
> to the textbox.
>
> I'm also trying to set a number format in another textbox as a currency
> (i.e. $###,###.##). I would like the inputed dollar amount in this text box
> to automatically default to a currency format of $###,###.##.
>
> Not sure if this can be done through the properties window or not.
>
> any information would be appreciated.
>
> --
> Regards,
>
> timmulla