How can I get a macro to run another macro upon completion?

C

CJ

I have a macro that creates a signature block, and asks the user to enter a
three digit user name, and then instructs user to run a second macro to
convert the initials to full name and I.D.#.

How can I get the macros to run successively? Help much appreciated!
 
S

Stephen English

You don't necessarily need a second macro
Try this

Dim strUser as String

strUser = InputBox("Please enter your three digit user name","Name?")
Select Case struser
Case "SDE"
Name = "Stephen English"
ID = 1234
Case "CJ"
Name = "Chris Johnson"
ID=1235
end select

and you just keep going with what you want to do with it.

If you need to display a user form, then when the user clicks the OK on the
UserForm, set the .tag property of the form to the initials and use it in
your macro

HTH
Stephen English
 
C

CJ

Hi, Steve. This macro will be used by approximately 60 people. While this
would work if only one person were using it, but what to do in the case of 60
different names and 60 different I.D. numbers? I had set up the second macro
to search and replace on the entire document on the three initials (.xxx).
Would it be possible to do the input box and then have it search and replace
on that? Then couldn't I then simply copy the second macro code up into the
first macro?

I'm a very green beginner with VBA, so please forgive me if I sound exactly
like I am -- a newbie. Thanks
 

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