Macro calling another Macro

W

William Benson

I did not get an answer that worked for me in an earlier post, am trying
again - if someone can figure out what is wrong I would really appreciate
it:

I have a subprocedure shown below, in a module which is named CharStats, in
Personal.xls:

Public Sub FindChar()
frmFindCharacters.Show
End Sub

I want the click event of command button on a sheet in another open workbook
to call it, and wrote:

Private Sub CommandButton1_Click()
Application.Run "Personal.xls!FindChar"
End Sub

I am getting an error message saying : "The macro 'Personal.xls!FindChar'
cannot be found.

Pls help, thanks.
 
D

Damien McBain

William Benson said:
I did not get an answer that worked for me in an earlier post, am trying
again - if someone can figure out what is wrong I would really appreciate
it:

I have a subprocedure shown below, in a module which is named CharStats,
in Personal.xls:

Public Sub FindChar()
frmFindCharacters.Show
End Sub

I want the click event of command button on a sheet in another open
workbook to call it, and wrote:

Private Sub CommandButton1_Click()
Application.Run "Personal.xls!FindChar"
End Sub

I am getting an error message saying : "The macro 'Personal.xls!FindChar'
cannot be found.

How bout

FindChar

and shange the sub to just plain sub not private sub

I'm not much of a techo but thats how I call other subroutines
 
T

Tom Ogilvy

I copied your code from your posting and renamed the module in personal.xls
to CharStats. Created a Userform in Personal.xls named frmFindCharacters.
Added a commandbutton1 in another workbook and pasted your event code there.
It worked fine for me.
 

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