Hi cyberspace,

In a previous code, I wanted to implement a routine within a sub that
would perform the last part of the code :

Private Function BellyDance(ByRef ArrX() As String, ByRef ArrY() As
String, _wks1 As Worksheet, wks2 As Worksheet, wks3 As Worksheet)
Dim rg As range
Dim i As Long, j As Long
Dim r As Long
'rg.Value = "ok"
r = 2
For i = 0 To UBound(ArrX, 1)
  For j = 0 To UBound(ArrY, 1)
    If UCase(ArrY(j, 1)) = UCase(ArrX(i, 1)) Then
      wks2.Rows(ArrY(j, 0)).Copy wks3.Rows(r)
      r = r + 1
    End If
  Next j
Next i
Set rg = wks3.range("A1").CurrentRegion
Set BellyDance = rg
End Function

How can I change this to :

Sub BellyDance(ByRef ArrX() As String, ByRef ArrY() As String, _wks1
As Worksheet, wks2 As Worksheet, wks3 As Worksheet)

and the syntax for the calling part as it seems "call" is optional
when calling a sub, sometimes I see ... call name_of_the_sub ...and
sometimes i can just see ... name_of_the_sub ...

Is there any difference?

I know how to call sub without parameters and sometimes with
parameters but for this code above, it wouldn't work, error at the
line of the call.

Any idea?

Cyberuser,

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

Reply via email to