Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
Posts: 509
Default optional parameter

Thanks Tom.

--



"Jim Thomlinson" wrote:

You bet...

Sub test(Optional ByVal Stuff As Integer = 100)
MsgBox Stuff
End Sub

Sub TryIt()
Call test
Call test(50)
End Sub

Note when you call the sub the optional argument shows up in square
brackets. Also optional arguments must show up at the end of the argument
list.
--
HTH...

Jim Thomlinson


"Ben" wrote:

Hi all,

If there's a Optional parameter in the Sub:

Sub test( option....)
...
...
end sub

is the parameter pass by ref or by val in the optional paramater? Thanks.

Ben


--

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default optional parameter

That must have been a good answer. You think I'm Tom. I'm flattered...
--
HTH...

Jim Thomlinson


"Ben" wrote:

Thanks Tom.

--



"Jim Thomlinson" wrote:

You bet...

Sub test(Optional ByVal Stuff As Integer = 100)
MsgBox Stuff
End Sub

Sub TryIt()
Call test
Call test(50)
End Sub

Note when you call the sub the optional argument shows up in square
brackets. Also optional arguments must show up at the end of the argument
list.
--
HTH...

Jim Thomlinson


"Ben" wrote:

Hi all,

If there's a Optional parameter in the Sub:

Sub test( option....)
...
...
end sub

is the parameter pass by ref or by val in the optional paramater? Thanks.

Ben


--

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
How to choose if I use a parameter or not in a parameter query Arnaud Excel Discussion (Misc queries) 0 March 8th 07 01:19 PM
Optional hyphen? Eric Excel Discussion (Misc queries) 4 October 19th 06 01:31 AM
format optional parameter compound Excel Worksheet Functions 0 September 26th 05 10:55 PM
format optional parameter compound Excel Discussion (Misc queries) 0 September 16th 05 06:20 PM
Excel2000: How to check for Optional parameter=Nothing Arvi Laanemets Excel Programming 10 April 27th 05 06:13 PM


All times are GMT +1. The time now is 04:16 PM.

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"