Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default autorun a macro

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
--
Smudge
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default autorun a macro


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

--
Bearacad

-----------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...fo&userid=3501
View this thread: http://www.excelforum.com/showthread.php?threadid=57056

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default autorun a macro

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

Many Many thanks
--
Smudge


"Bearacade" wrote:


Within the Visual Basic Editor (Alt-F11), click on the ThisWorkbook and
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 it


--
Bearacade


------------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
View this thread: http://www.excelforum.com/showthread...hreadid=570565


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 113
Default autorun a macro

Smudge, Bearcade's code works
--
Robert



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 53
Default autorun a macro

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


"Robert" wrote:

Smudge, Bearcade's code works
--
Robert





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
Autorun Macro rexmann Excel Discussion (Misc queries) 2 August 2nd 06 02:03 PM
MACRO AUTORUN b52shut Excel Discussion (Misc queries) 1 December 15th 05 08:48 AM
Excel Macro Issue Trying to autorun Macro Upon Opening Worksheet wyndman Excel Programming 2 May 25th 04 06:59 PM
Autorun a macro Nigel Chapman Excel Programming 1 February 4th 04 01:02 PM
Autorun a macro No Name Excel Programming 2 November 21st 03 09:26 PM


All times are GMT +1. The time now is 07:53 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"