Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code: call subprocedure
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! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code: call subprocedure
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." "Terry" wrote: 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! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code: call subprocedure
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 -- Leith Ros ----------------------------------------------------------------------- Leith Ross's Profile: http://www.excelforum.com/member.php...fo&userid=1846 View this thread: http://www.excelforum.com/showthread.php?threadid=49325 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code: call subprocedure
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 -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=493258 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code: call subprocedure
Thank you very much!
"bpeltzer" ... 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." "Terry" wrote: Hi, I am writing a VBA program?¡êThe program structure listed below¡êo 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! |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA code: call subprocedure
Thank you very much!
"Leith Ross" дÈëÏûÏ¢ÐÂÎÅ:Leith.Ross.200cem_1134526395.78@excel forum-nospam.com... 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 -- Leith Ross ------------------------------------------------------------------------ Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465 View this thread: http://www.excelforum.com/showthread...hreadid=493258 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro subprocedure | Excel Discussion (Misc queries) | |||
Hyperlink to a subprocedure in an other workbook | Excel Worksheet Functions | |||
how to call subprocedure from within procedure? | Excel Programming | |||
Code in one workbook to call code in another XL file | Excel Programming | |||
Passing range to subprocedure - maybe? | Excel Programming |