Basic Macro Question
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: Basic Macro Question

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

     
    I want to put some macro to run when excel opens.

    How do I do this. Where is the on open property for the worbook?

    Sorry to trouble you with this question

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    =ActiveCell.Address
    Posts
    478
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hiya,

    I'm not 100% sure on this because I've got a weird Network installation of Excel and cannot get my personal.xls to work, but try putting the code you want to run in the ThisWorkbook bit of your personal.xls, i.e.

    Private Sub Workbook_Open()
    MsgBox ("Excel has Started!")
    End Sub

    (The personal.xls will reside somewhere like C:program filesmicrosoft officexlstart)

    Rgds
    AJ

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi
    I think if you name the macro Auto_Open, it will run when the book is opened...
    If no, right-click on the Excel icon in the upper left of your screen and choose view code. This is the workbook code class modul.
    Two dropdowns at the top of the page.
    The one on the left needs to say workbook,
    choose Workbook open on the right.
    Call your macro from the sub by typing in the macro name or typing:
    Call MacroName
    Tom

  4. #4
    Board Regular
    Join Date
    Feb 2002
    Location
    Where the wild roses grow
    Posts
    285
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Right click your sheet tabs and select View Code. On the left hand side of the VBA screen, double click This Workbook

    From the two dropdown boxes above the blank VB page choose Workbook from the left one and Open from the right one

    Audiojoe
    Might as well face it, I'm addicted to love

    P.S: Although I was 3rd to get my reply up for this, I'm leaving this one on just to show I can do some things right
    Real love with soap and three girls etc...

    [ This Message was edited by: Audiojoe on 2002-04-04 07:54 ]

  5. #5
    New Member
    Join Date
    Mar 2002
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

      
    Cheers guys the third reply was just what I was looking for

    thanks for the help

    Mathew

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 

 
DMCA.com