auto run macro at workbook open

J

Juan Guemes

After using TS to open a workbook in XL2002 should I use
workbook_open or auto_run to activate a macro? I have
tried both with no success.
Sub Workbook_Open() '(for example)
Range("A1").Select
Selection.Copy
Range("A2").Select
ActiveSheet.Paste
End Sub
I've tried the same code using Auto_Run.
Thanks
 
C

Chip Pearson

You need to put the Workbook_Open code in the ThisWorkbook code
module, not a regular code module. Alternately, you can use
Auto_Open (not Auto_Run) in a regular code module.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 

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