Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
TitleConvert text into the Currency data type (or other types)
KeywordsCCur, convert, currency
CategoriesSoftware Engineering
 
Thanks to Chimeric.

Use an On Error statement to check for invalid values while using CCur to perform the conversion.

 
' 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
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated