Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default Does IsMissing only work with Variants?

If I code a Function statement

Function Temp(Optional abc As Single)

then calling the function with no arguments

=temp()

[abc] gets assigned the value "0" and the IsMissing(abc) test always
fails. If I change the Function statement to

Function Temp(Optional abc)

then everything works.

Is there no way to have an optional numeric argument and be able to
assign the default in the function?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Does IsMissing only work with Variants?

Methinks someone did not read the help files for IsMissing... <g

--
Rick (MVP - Excel)



"Prof Wonmug" wrote in message
...
If I code a Function statement

Function Temp(Optional abc As Single)

then calling the function with no arguments

=temp()

[abc] gets assigned the value "0" and the IsMissing(abc) test always
fails. If I change the Function statement to

Function Temp(Optional abc)

then everything works.

Is there no way to have an optional numeric argument and be able to
assign the default in the function?


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 61
Default Does IsMissing only work with Variants?

On Fri, 30 Apr 2010 00:49:13 -0400, "Rick Rothstein"
wrote:

Methinks someone did not read the help files for IsMissing... <g


When I click on the Help button from the VBA IDE, I get "This page is
not available". It's been that way for quite a few days.

I also searched online for "VBA IsMissing" and "VBA Optional
Arguments" and a few others. I could not find anywhere that it
mentioned anything about IsMissing and datatypes.

I finally found something on VB.Net (which I am not running) about
IsMissing not being supported and it showed an example of assigning a
default value on the Function statement:

Function Temp(Optional abc As Single = 1)

That fixed the problem.

Thank you so much. You have been very helpful....not
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Does IsMissing only work with Variants?

You could have mentioned that you tried to look it up and that your help
files were not working... we tend to try to direct questioners to the help
files in those cases where the help files provides a complete answer. Here
is an link to the online IsMissing help file...

http://msdn.microsoft.com/en-us/libr...(v=VS.60).aspx

--
Rick (MVP - Excel)



"Prof Wonmug" wrote in message
...
On Fri, 30 Apr 2010 00:49:13 -0400, "Rick Rothstein"
wrote:

Methinks someone did not read the help files for IsMissing... <g


When I click on the Help button from the VBA IDE, I get "This page is
not available". It's been that way for quite a few days.

I also searched online for "VBA IsMissing" and "VBA Optional
Arguments" and a few others. I could not find anywhere that it
mentioned anything about IsMissing and datatypes.

I finally found something on VB.Net (which I am not running) about
IsMissing not being supported and it showed an example of assigning a
default value on the Function statement:

Function Temp(Optional abc As Single = 1)

That fixed the problem.

Thank you so much. You have been very helpful....not


Reply
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
Optional IsMissing is not working korokke[_3_] Excel Programming 6 May 28th 06 04:57 PM
IsMissing Function mikelee101[_3_] Excel Programming 0 March 21st 06 06:41 PM
IsMissing Function Tom Ogilvy Excel Programming 0 March 21st 06 06:40 PM
IsMissing() Kuzemdoo Dawuni Excel Programming 3 October 15th 04 08:01 PM
IsMissing() Kuzemdoo Dawuni Excel Programming 3 October 15th 04 03:19 AM


All times are GMT +1. The time now is 01:57 AM.

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

About Us

"It's about Microsoft Excel"