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: 16
Default Using (what goes in here) for sub routine

Was reading the Excel Help on the Sub Statement and this is the example that
is shown:
' Sub procedure definition.
' Sub procedure with two arguments.
Sub SubComputeArea(Length, TheWidth)
Dim Area As Double ' Declare local variable.
If Length = 0 Or TheWidth = 0 Then
' If either argument = 0.
Exit Sub ' Exit Sub immediately.
End If
Area = Length * TheWidth ' Calculate area of rectangle.
Debug.Print Area ' Print Area to Debug window.
End Sub

I notice that the there is Lenght and TheWidth in the brackets after the sub
name. Am I correct in assuming that these have to be given values
somewhere? I notice in the sub routine they are not defined so I am
assuming they are definned elsewhere. I am trying to learn about the
arguments that can go in that set of brackets after the sub name to further
my knowledge. I see things like Sub Name(ByVal etc...) and was trying to
figure out the whens and whys of using that and where is that stuff defined
as I cannot find it in the help when I do a search for ByVal etc....

Thanks in Advance and have a Happy New Year everyone

Wally Steadman


 
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
sub routine Gord Dibben Excel Discussion (Misc queries) 0 November 13th 09 12:15 AM
Sort Routine VBA weeper Excel Programming 2 September 29th 04 02:59 PM
SUB ROUTINE tokirk Excel Programming 1 January 19th 04 02:17 AM
Routine?? Zax Excel Programming 3 December 19th 03 05:50 PM
Need VBA Routine John M. Lembo Excel Programming 0 July 13th 03 01:51 AM


All times are GMT +1. The time now is 12:20 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"