UDF Methods For Determining Currency or Double

202 Views Asked by At

I'm creating a UDF in VB.NET that sometimes works with currency, which I would need to use the Decimal format in VB. But sometimes I working with time or just a plain double. What methods are out their for determining how I should add the values up, with a decimal or double?

I prefer not to have excel return the actual range for simplicity sake but will do if I need to determine if it is formatted as currency.

1

There are 1 best solutions below

3
On BEST ANSWER

Since Excel uses Doubles for currency, time values, integers and all other numbers its not usually neccessary to find out how the number is formatted for Excel display purposes: just add the values up.= as doubles.