I have a string a= $55.55
I need to verify whether the String is in the correct Format like $xx.xx
How to do that?
Will it always be xx.xx?
You can do a few things.
1. Check the first character is your $ sign
if left(x,1)="$" then
2. Check the "." is present and in the correct place.
if pos>0 mid(x,pos,1)="." then
Thats a start of you. You could check each character is numeric and not a string is you really wanted.
I am using the following code,
If Instr(prodPrice,".") = 4 or Instr(prodPrice,".") = 5 and Instr(prodPrice,"$")=1 Then
I thought that there might be a funtion like formatcurrency
thank you for your quick reply
One can also use Regexp object and use the test method defined.
Create a RegExp object
Then choose a pattern that matches $XX.XX.
Now use the Test method defined for regular expressions.
Winds of Change
This might help... http://regexlib.com/Search.aspx?k=cu...;ps=20&p=2
That'z awesome info!!