Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Good Afternoon.
I have 5 Public Subs() in 5 different worksheets. I have the following code in Module 2 that I would like to use to call all 5 subs. But I keep getting a "sub or function not defined" error: CODE: Public Sub SendDataToReport() Call SendToWord Call SendToWord2 Call SendToWord3 Call SendToWord4 Call SendToWord5 End Sub /CODE: Why does this happen? How can I call all five subs from within module 2? All worksheet subs are public not private. Suggestions? Thanks for the help chris |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Best would not to have them in the worksheets - reserve worksheet code for
events associated with the worksheet. If you wish to keep them there, preface them with the sheet code name CODE: Public Sub SendDataToReport() Call Sheet1!SendToWord Call Sheet2!SendToWord2 Call Sheet3!SendToWord3 Call Sheet4!SendToWord4 Call Sheet5!SendToWord5 End Sub -- Regards, Tom Ogilvy "Chris Villanueva" wrote in message ... Good Afternoon. I have 5 Public Subs() in 5 different worksheets. I have the following code in Module 2 that I would like to use to call all 5 subs. But I keep getting a "sub or function not defined" error: CODE: Public Sub SendDataToReport() Call SendToWord Call SendToWord2 Call SendToWord3 Call SendToWord4 Call SendToWord5 End Sub /CODE: Why does this happen? How can I call all five subs from within module 2? All worksheet subs are public not private. Suggestions? Thanks for the help chris |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the info Tom. I will incorporate your advice
into my programming style. Thanks again. Chris -----Original Message----- Best would not to have them in the worksheets - reserve worksheet code for events associated with the worksheet. If you wish to keep them there, preface them with the sheet code name CODE: Public Sub SendDataToReport() Call Sheet1!SendToWord Call Sheet2!SendToWord2 Call Sheet3!SendToWord3 Call Sheet4!SendToWord4 Call Sheet5!SendToWord5 End Sub -- Regards, Tom Ogilvy "Chris Villanueva" wrote in message ... Good Afternoon. I have 5 Public Subs() in 5 different worksheets. I have the following code in Module 2 that I would like to use to call all 5 subs. But I keep getting a "sub or function not defined" error: CODE: Public Sub SendDataToReport() Call SendToWord Call SendToWord2 Call SendToWord3 Call SendToWord4 Call SendToWord5 End Sub /CODE: Why does this happen? How can I call all five subs from within module 2? All worksheet subs are public not private. Suggestions? Thanks for the help chris . |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Actually, the ! should be a period - my mistake.
Public Sub SendDataToReport() Call Sheet1.SendToWord Call Sheet2.SendToWord2 Call Sheet3.SendToWord3 Call Sheet4.SendToWord4 Call Sheet5.SendToWord5 End Sub -- Regards, Tom Ogilvy "ChrisV" wrote in message ... Thanks for the info Tom. I will incorporate your advice into my programming style. Thanks again. Chris -----Original Message----- Best would not to have them in the worksheets - reserve worksheet code for events associated with the worksheet. If you wish to keep them there, preface them with the sheet code name CODE: Public Sub SendDataToReport() Call Sheet1!SendToWord Call Sheet2!SendToWord2 Call Sheet3!SendToWord3 Call Sheet4!SendToWord4 Call Sheet5!SendToWord5 End Sub -- Regards, Tom Ogilvy "Chris Villanueva" wrote in message ... Good Afternoon. I have 5 Public Subs() in 5 different worksheets. I have the following code in Module 2 that I would like to use to call all 5 subs. But I keep getting a "sub or function not defined" error: CODE: Public Sub SendDataToReport() Call SendToWord Call SendToWord2 Call SendToWord3 Call SendToWord4 Call SendToWord5 End Sub /CODE: Why does this happen? How can I call all five subs from within module 2? All worksheet subs are public not private. Suggestions? Thanks for the help chris . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
calling a module | Excel Discussion (Misc queries) | |||
calling up information from a different worksheet. | Excel Worksheet Functions | |||
Calling VBA function that is in another module | Excel Programming | |||
Calling a module function from a class method | Excel Programming | |||
Calling Macros oustide current module | Excel Programming |