View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
papou papou is offline
external usenet poster
 
Posts: 110
Default Data Types help ... Overflow errors

Hello Larry
Since one of your variables (guests) used in your calculation is declared as
Long (that's between -2 147 483 648 and 2 147 483 647) I can hardly see this
working because the "result" variable is declared for a lesser value?
Try and declare "result" as long?
HTH
Cordially
Pascal

"Larry Levinson" a écrit dans le message
de news: ...
I have a formula to calculate a percentage,

dim used, guests as Long, result as single
result = (USED / GUESTS)*100

and get the dreaded overflow on data type error on some of the
answers.

I tried double, variant and decimal in the dim statment. decimal
wouldn't even take in the dim.

then, I tried, result = round((USED / GUESTS)*100,1)

but the syntax gets hung up on the parentheses ...

help greatly appreciated.


Larry Levinson
Talking up to the vocal ...
LLevinson*Bloomberg.net
(remove the star etc ....)