Testing for a currency ..

M

Mark Rosenkrantz

Dear members;

I have auserform with textbox in which amounts have to be entered.
I want to test for correct input.

My question is how do I do that.
Is there something like : Isdate, but then for currencies ??

Thanks in advance.

Mark.
 
O

onedaywhen

Nothing built in so here's a suggestion:

Function IsCurrency(ByVal Expression As Variant) As Boolean
Dim curTest As Currency
On Error Resume Next
curTest = CCur(Expression)
IsCurrency = (Err.Number = 0)
On Error GoTo 0
End Function
 
M

Mark Rosenkrantz

Thanks;

I'll try that.

Mark.

onedaywhen said:
Nothing built in so here's a suggestion:

Function IsCurrency(ByVal Expression As Variant) As Boolean
Dim curTest As Currency
On Error Resume Next
curTest = CCur(Expression)
IsCurrency = (Err.Number = 0)
On Error GoTo 0
End Function

"Mark Rosenkrantz" <[email protected]> wrote in message
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top