LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Strange error on function

Hi,

I have the following function:

Function volume(height As Byte, width As Byte, Optional length As Single)
If IsMissing(length) Then
volume = height * width
Else
volume = height * width * length
End If
End Function

If I type in a number which is greater than 1 in the width argument, I get
the #value error. I'm not sure why because I set width as byte. Is there
something wrong with my code that I can't see? This is a sample that I'm
playing with but it's driving me crazy. Any help will be greatly appreciated.

Thanks in advance.

Herman
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
strange error martinbarnes Excel Discussion (Misc queries) 3 April 1st 08 09:02 PM
Strange error with basic divide function Brent Excel Worksheet Functions 1 June 28th 06 09:20 PM
Strange error Andy Setting up and Configuration of Excel 1 April 18th 06 08:11 PM
Very strange error superkopite Excel Discussion (Misc queries) 3 February 19th 06 11:21 AM
Strange error Filips Benoit Excel Programming 7 October 20th 04 08:02 PM


All times are GMT +1. The time now is 06:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"