macro to run macro

E

ellebelle

I have macro that I run in project. It has pop up dialogue boxes which
require me to make two choices from drop down menus every time I run it - job
name and report date.
It outputs a report for different jobs contained in a project file.
I would like a macro that runs the report macro for every job. I don't mind
if the job name is hard wired into the macro and if it changes then I edit
the macro. The date could be like that as well if easy.

Is this possible? I have no idea how to do it.

Ellebelle
 
J

John

ellebelle said:
I have macro that I run in project. It has pop up dialogue boxes which
require me to make two choices from drop down menus every time I run it - job
name and report date.
It outputs a report for different jobs contained in a project file.
I would like a macro that runs the report macro for every job. I don't mind
if the job name is hard wired into the macro and if it changes then I edit
the macro. The date could be like that as well if easy.

Is this possible? I have no idea how to do it.

Ellebelle

Ellebelle,
Yes, this certainly is possible and would be more efficient then having
to select each job and date every time you want a report. It might be
easier to help you by taking a look at the code you already have.
Depending on the structure it may not be too difficult to modify it, but
it may also be better just to start over from scratch. If you can send
me a sample file with your code and instruction on exactly what you want
to do, I'll take a look at it. I'll warn you, I do ask a lot of
questions.

By the way, questions on VBA should normally be posted on our sister
website, microsoft.public.project.developer.

John
Project MVP
jensenj6atatcomcastdotdotnet
(remove obvious redundancies)
 
E

ellebelle

that would be great but I am not allowed to send any files out for secutiry
reasons. Could you tell me how I call another macro in VB?
 
J

John

ellebelle said:
that would be great but I am not allowed to send any files out for secutiry
reasons. Could you tell me how I call another macro in VB?

ellebelle,
I think you mean "security" instead of "secutiry". If it is a matter of
proprietary data, I can send you a macro that will remove all sensitive
data from the file. You could try it and see if it sanitizes the file
adequately and then we could go from there.

Meanwhile, calling one VBA macro from another depends on various
factors. Is it in the same module? Can variables be shared via Public
declaration or does the call need to include a string of arguments?

However, from you post, it isn't clear why you even need a second macro.
If all you are doing is setting up a couple of variables via user input
and then preparing a report based on the input, that can easily be done
with a single macro.

John
Project MVP
 

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

Top