+ Reply to Thread
Results 1 to 2 of 2

macro to start on workbook opening

  1. #1
    Nigel
    Guest

    macro to start on workbook opening

    Hi,
    can anyone help me with a macro to start on opening a book?
    when the book is opened, start this " Nextstage.Show "

    Then when i save, if the file name = quotes & orders then rename it to (D2 &
    quotes & orders). this is to stop the possibility of the same named file
    being open twice.

    Kindest Regards,

    Nigel

  2. #2
    Bob Phillips
    Guest

    Re: macro to start on workbook opening

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
    Boolean)
    If ThisWorkbook.Name = "quotes & orders.xls" Then
    ThisWorkbook.SaveAs "D2 quotes & orders.xls"
    Cancel = True
    End If
    End Sub

    Private Sub Workbook_Open()
    NextStage.Show
    End Sub

    'This is workbook event code.
    'To input this code, right click on the Excel icon on the worksheet
    '(or next to the File menu if you maximise your workbooks),
    'select View Code from the menu, and paste the code



    --

    HTH

    RP
    (remove nothere from the email address if mailing direct)


    "Nigel" <[email protected]> wrote in message
    news:[email protected]...
    > Hi,
    > can anyone help me with a macro to start on opening a book?
    > when the book is opened, start this " Nextstage.Show "
    >
    > Then when i save, if the file name = quotes & orders then rename it to (D2

    &
    > quotes & orders). this is to stop the possibility of the same named file
    > being open twice.
    >
    > Kindest Regards,
    >
    > Nigel




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1