autorun a macro

G

Guest

Hello,

I'm new to Excel but used Lotus 123 version 2 many more years ago than I
would like to admit. Forgot most of what I knew about writing macros but do
remember that macros could linked to a key or to the opening of the
spreadsheet.

I have just started to use macros with Excel (I'm at the recording stage,
but going into the script to try to work out what it does)

Can anyone help me with code to invoke the macro as soon as the worksheet is
opened please. Please, please, please be gentle and explain it in simple
terms as the brain runs a lot slower these days.

Many thanks
 
B

Bearacade

Within the Visual Basic Editor (Alt-F11), click on the ThisWorkbook an
enter this into the main window:

Private Sub Workbook_Open()

MsgBox ("This Macro Run on Open")

End Sub

Close the Visual Basic Editor, Save the Worksheet, Close it and Open i
 
G

Guest

Thank you, I wasn't expecting an answer so quickly. will give it a go and get
back to you.

Many Many thanks
 
G

Guest

Thank you both. As always so impressed that people give up their time and
knowledge so freely!
 

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