Home > How-To Library > Coding Basics
How to Convert text into the Currency data type
**************************************************************** * © 2007 CodeItBetter http://www.codeitbetter.com * * This notice MUST stay intact for legal use * **************************************************************** Option Explicit ' Convert any value into currency format. If the value does not make sense, return 0.00. Public Function cvCur(ByVal Value As Variant) As Currency On Error Resume Next cvCur = CCur(Value) If Err.Number <> 0 Then cvCur = 0 End Function Private Sub cmdConvert_Click() lblCurrency.Caption = Format$(cvCur(txtCurrency.Text), "Currency") End Sub
If you would like to submit your code here please us. Do not forget to mention your name. We are always thankful to each and everyone of you who submitted their code here.