ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Testing for a currency .. (https://www.excelbanter.com/excel-programming/282335-testing-currency.html)

Mark Rosenkrantz

Testing for a currency ..
 
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.



onedaywhen

Testing for a currency ..
 
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" wrote in message ...
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.


Mark Rosenkrantz

Testing for a currency ..
 
Thanks;

I'll try that.

Mark.

"onedaywhen" wrote in message
om...
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" wrote in message

...
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.





All times are GMT +1. The time now is 01:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com