Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
JaB JaB is offline
external usenet poster
 
Posts: 23
Default Run on open macro

Hi there

I would like a macro to run on open in a particular workbook. I know there
is a simple visual basic line that will do this for me but it escapes me!

Does anyone know?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 196
Default Run on open macro

Hi

You need to place the code (or reference it from) the Workbook_Open
event in the ThisWorkbook module of the workbook concerned - navigate
to the little Excel workbook icon next to the File Menu, right-click
and go View Code. This brings up the Visual Basic Editor with the
ThisWorkbook module open. Paste your code in there with the following
name:

Private Sub Workbook_Open()

'Your code here

End Sub

I hope this helps!

Richard


JaB wrote:

Hi there

I would like a macro to run on open in a particular workbook. I know there
is a simple visual basic line that will do this for me but it escapes me!

Does anyone know?

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
Can a Macro open workbooks on a SharePoint Site? Randy Excel Discussion (Misc queries) 0 August 29th 06 07:21 PM
error when running cut & paste macro Otto Moehrbach Excel Worksheet Functions 4 August 9th 06 01:49 PM
Open File within a macro Rob Excel Discussion (Misc queries) 10 June 29th 06 08:55 PM
Macro to open files isn't updating correctly telewats Excel Discussion (Misc queries) 2 February 21st 06 09:04 PM
Open another program(Word) with Excel macro? Al New Users to Excel 1 December 20th 05 08:52 PM


All times are GMT +1. The time now is 08:21 PM.

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

About Us

"It's about Microsoft Excel"