Using the Call Statement

  • Thread starter Thread starter caldog
  • Start date Start date
C

caldog

I have quite a few of the same set of coding in my Excel VBA. I have been
told, but cannot find any thing in the books that I have, about something
called the ‘Call Statement’. Can somebody explain to me or show me how this
type of VBA code works.

Thanks
 
Sub FormatMySheet ()
SameOldRoutine 'goes to Sub name
Do some other stuff
End Sub

Sub SameOldRoutine ()
do the same stuff
End Sub

By putting the name of a sub in another sub, code execution goes to the
named sub, runs that code, then returns to the calling sub to finish it's
code.

Mike F
 
Lots of times, VBA's help is actually helpful. You may want to look there for
Call.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top