Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 180
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default 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
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
Macro subprocedure orquidea Excel Discussion (Misc queries) 6 May 13th 08 01:10 AM
Hyperlink to a subprocedure in an other workbook LimaB Excel Worksheet Functions 0 July 20th 06 08:35 PM
how to call subprocedure from within procedure? dreamz[_12_] Excel Programming 23 November 1st 05 06:38 PM
Code in one workbook to call code in another XL file [email protected] Excel Programming 2 August 1st 05 03:37 PM
Passing range to subprocedure - maybe? Mike Gerbracht Excel Programming 2 July 26th 03 02:44 AM


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