View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Troubleshoot Overflow

Formulate expresions to demand Double or Long math:

Sub bad_math()
MsgBox (24 * 60 * 60)
End Sub

will fail on overflow, but:

Sub good_math()
MsgBox (24# * 60 * 60)
End Sub

will work just fine.
--
Gary''s Student - gsnu200785


"JingleRock" wrote:

I have read that the Overflow Error is frequently associated with
variable declaration. Do you have any suggestions, other than trial
and error in changing declarations, for troubleshooting this error?
Thanks for your help.