ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Calling a procedure in a procedure (https://www.excelbanter.com/excel-programming/307274-re-calling-procedure-procedure.html)

N10

Calling a procedure in a procedure
 

"Alex" wrote in message
...
I'm getting the following error..

Compile Error:

Expected variable or procedure, not module

When I run my macro and it shows this part of my code....

Finish = MsgBox("Click YES to finish report, Click NO to end." & Chr(13) &

_
"Rerun the M & S Macro if you need to add more reports", vbYesNo +
vbInformation)
If Finish = vbYes Then
Summary '<----- THIS PART IS HIGHLIGHTED ON ERROR
Exit Sub
Else
MsgBox "Let me know if this macro has helped you."
End If

BTW I do have a variable for this though it's not here.

Any ideas why the error?



I new to programming so I may be off the mark here

should the code nor read


If Finish = vbYes Then
call Summary
Exit Sub
Else
MsgBox "Let me know if this macro has helped you."
End If

Hope this helps

Best N10



ALEX

Calling a procedure in a procedure
 


"N10" wrote:


I new to programming so I may be off the mark here

should the code nor read


If Finish = vbYes Then
call Summary
Exit Sub
Else
MsgBox "Let me know if this macro has helped you."
End If

Hope this helps

Best N10


If' tried using CALL as well but get the same error. VBA knows that with or
without the CALL statement, I want to run the additional procedure.

N10

Calling a procedure in a procedure
 

"Alex" wrote in message
...


"N10" wrote:


I new to programming so I may be off the mark here

should the code nor read


If Finish = vbYes Then
call Summary
Exit Sub
Else
MsgBox "Let me know if this macro has helped you."
End If

Hope this helps

Best N10


If' tried using CALL as well but get the same error. VBA knows that with

or
without the CALL statement, I want to run the additional procedure.



Could Summary be an allocated term in VBA ?

Like coding call OPEN would cause an error

Also does the routine Summary when ran directly ?





All times are GMT +1. The time now is 03:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com