VBA code: call subprocedure

  • Thread starter Thread starter Terry
  • Start date Start date
T

Terry

Hi,
I am writing a VBA program¡£The program structure listed below£º

Private Sub b(i As Integer, j As Integer)
......
End Sub

Sub a()
....
b (i, j)
...
End Sub

It appeard error message while I call subprocedure b in main-procedure a.
Error message :
Compile error
Miss :=

Would you tell me how to write the code in order to call the subprocedure b?
Thanks a lot!
 
Put the word call in front of the procedure call: call b(i,j). Not entirely
sure why, but the help suggests: "a function call can't stand by itself, and
Sub procedure calls sometimes require the Call keyword, depending on how you
specify their arguments."
 
Hello Terry,

When calling a Sub procedure with parentheses like b(i, j), you mus
precede the cal with the keyword Call...

Call b(i,j)

Sincerely,
Leith Ros
 
Hello Terry,

When calling a Sub procedure with parentheses like b(i, j), you must
precede the cal with the keyword Call...

Call b(i,j)

Sincerely,
Leith Ross
 
Thank you very much!
bpeltzer said:
Put the word call in front of the procedure call: call b(i,j). Not
entirely
sure why, but the help suggests: "a function call can't stand by itself,
and
Sub procedure calls sometimes require the Call keyword, depending on how
you
specify their arguments."
 
Back
Top