Thread: Overflow error
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Grd Grd is offline
external usenet poster
 
Posts: 118
Default Overflow error

Hi,

I've created a simple funcion to calculate the volume based on three inputs,
height, width and depth. I've make the variables bytes. When the result of
the volume is over 255 I get an overflow error. See the function below:

Function volume(height As Byte, width As Byte, depth As Byte)
volume = height * width * depth

End Function
--------------------------
Sub test()

Debug.Print volume(12, 22, 1)

End Sub

Can anyone help with why I'm getting the error. Thanks in advance

Regards
Janet