Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default auto run macro at workbook open

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default auto run macro at workbook open

http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy

"Juan Guemes" wrote in message
...
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default auto run macro at workbook open

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



"Juan Guemes" wrote in
message ...
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
auto open a workbook Jase Excel Discussion (Misc queries) 0 December 10th 08 02:05 PM
Auto open workbook(s)? Shek5150 Excel Discussion (Misc queries) 6 August 29th 08 05:58 PM
How to code VBA: Auto open workbook and run macro March Excel Discussion (Misc queries) 4 November 8th 07 08:25 PM
Auto Open Macro Launchnet Excel Worksheet Functions 7 July 20th 07 07:41 PM
auto open a workbook Mauricio[_2_] Excel Programming 1 October 27th 03 03:24 PM


All times are GMT +1. The time now is 07:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"