How to run macro for "private sub.."

P

PA

Dear All,

I try to run this macro :

For example:

Private Sub Workbook_Open()
Msgbox "Hello"
End Sub

But I can not see the macro name at all at macro dialog box (Tol-->Macro-->..)

Is there any way that I need to do enable me to run this macro without
delete the word"private"? eg via macro button or shorcut as usual

many thanks for your advise

PA
 
T

Tim Williams

Make it Public not Private, or create a new Public Sub which calls it.

Tim
 
P

PA

Dear JBeaucaire,

Do you mean there is no way to run that macro other than remove that word
"private" ?

Thanks alot

PA
 
G

Gord Dibben

It is not meant to be run manually. It is event code that runs when the
workbook oipens.

It is meant to be placed in Thisworkbook module.


Gord Dibben MS Excel 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