I am trying to get the line of code below to work but it won't work with a Double variable. Can someone tell me what I am doing wrong?
![]()
Please Login or Register to view this content.
I am trying to get the line of code below to work but it won't work with a Double variable. Can someone tell me what I am doing wrong?
![]()
Please Login or Register to view this content.
Last edited by ccpsc; 10-03-2012 at 01:21 AM. Reason: Change title
Try this instead:
![]()
Please Login or Register to view this content.
_________________
Microsoft MVP 2010 - Excel
Visit: Jerry Beaucaire's Excel Files & Macros
If you've been given good help, use theicon below to give reputation feedback, it is appreciated.
Always put your code between code tags. [CODE] your code here [/CODE]
?None of us is as good as all of us? - Ray Kroc
?Actually, I *am* a rocket scientist.? - JB (little ones count!)
Thanks that worked. I changed it to the code below which also works and better suits my needs. I don't understand how/why this works, can you explain it to me?
![]()
Please Login or Register to view this content.
That error means your formula has exceeded the limitations of the variable type. By expressly using the Clng() to constrain those whole numbers it seems to hold things in place properly. I can't say I fully understand it, but that's a known issue and the the known "workaround".
((6 - 0.05) * (1200 / 100)) / (60 * clng(60 * 24))
This part, 60 * clng(60 * 24), generates a value of 86400 which exceeds the Integer limit of 32767
Thanks guy's that makes sense
I have marked this thread solved for you.
In the future please select Thread Tools from the menu above and mark the thread as solved. Thanks.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks