+ Reply to Thread
Results 1 to 5 of 5

Display a message when a file is opened.

  1. #1
    Sheila
    Guest

    Display a message when a file is opened.

    I would like to display a message "Complete section two before entering
    section one" when an excel file is opened.
    Any help would be appreciated.



  2. #2
    Peter Jausovec
    Guest

    RE: Display a message when a file is opened.

    Hi Sheila,

    You need to create a new macro (ALT+F11) and add a Workbook_Opened event (on
    the left side click on ThisWorkbook; a new window will open and in left
    dropdown select Workbook and Workbook_Opened will be added). Next, you just
    add this line (between Private Sub Workbook_Opened() and End Sub):

    MsgBox "Complete section two before entering section one"

    Message box will be displayed when document is opened.
    --
    Best regards,
    Peter Jaušovec
    http://blog.jausovec.net
    http://office.jausovec.net


    "Sheila" je napisal:

    > I would like to display a message "Complete section two before entering
    > section one" when an excel file is opened.
    > Any help would be appreciated.
    >
    >


  3. #3
    Sheila
    Guest

    RE: Display a message when a file is opened.

    Thanks Peter this is exactly what I was looking for. Is it possible to change
    the size and color of this message?

    "Peter Jausovec" wrote:

    > Hi Sheila,
    >
    > You need to create a new macro (ALT+F11) and add a Workbook_Opened event (on
    > the left side click on ThisWorkbook; a new window will open and in left
    > dropdown select Workbook and Workbook_Opened will be added). Next, you just
    > add this line (between Private Sub Workbook_Opened() and End Sub):
    >
    > MsgBox "Complete section two before entering section one"
    >
    > Message box will be displayed when document is opened.
    > --
    > Best regards,
    > Peter Jaušovec
    > http://blog.jausovec.net
    > http://office.jausovec.net
    >
    >
    > "Sheila" je napisal:
    >
    > > I would like to display a message "Complete section two before entering
    > > section one" when an excel file is opened.
    > > Any help would be appreciated.
    > >
    > >


  4. #4
    Peter Jausovec
    Guest

    RE: Display a message when a file is opened.

    No, unfortunately you can't change the size and color with MsgBox. But you
    can create your custom form and adjust the whole appearance as you like it.

    Click ALT+F11 again, right click on the ThisWorkbook (on the right side) and
    select Insert -> User form. A new, blank form will show up; then just add the
    label to it, adjust the font size and color. Also add a button so the user
    can close the form (drag&drop the button to the form, double click on it and
    add this line of code:

    Unload Me

    (this will unload and close the form when you click on the button).

    Finally, go to the Workbook_Opened event and add this line:

    UserForm1.Show

    (UserForm1 is the name of the form you created - you can change it in the
    properties - click on the UserForm1 and in the Properties window find the
    (Name) property).

    Hope this helps.
    --
    Best regards,
    Peter Jaušovec
    http://blog.jausovec.net
    http://office.jausovec.net


    "Sheila" je napisal:

    > Thanks Peter this is exactly what I was looking for. Is it possible to change
    > the size and color of this message?
    >
    > "Peter Jausovec" wrote:
    >
    > > Hi Sheila,
    > >
    > > You need to create a new macro (ALT+F11) and add a Workbook_Opened event (on
    > > the left side click on ThisWorkbook; a new window will open and in left
    > > dropdown select Workbook and Workbook_Opened will be added). Next, you just
    > > add this line (between Private Sub Workbook_Opened() and End Sub):
    > >
    > > MsgBox "Complete section two before entering section one"
    > >
    > > Message box will be displayed when document is opened.
    > > --
    > > Best regards,
    > > Peter Jaušovec
    > > http://blog.jausovec.net
    > > http://office.jausovec.net
    > >
    > >
    > > "Sheila" je napisal:
    > >
    > > > I would like to display a message "Complete section two before entering
    > > > section one" when an excel file is opened.
    > > > Any help would be appreciated.
    > > >
    > > >


  5. #5
    Sheila
    Guest

    RE: Display a message when a file is opened.

    Thanks for all of your help Peter.

    "Peter Jausovec" wrote:

    > No, unfortunately you can't change the size and color with MsgBox. But you
    > can create your custom form and adjust the whole appearance as you like it.
    >
    > Click ALT+F11 again, right click on the ThisWorkbook (on the right side) and
    > select Insert -> User form. A new, blank form will show up; then just add the
    > label to it, adjust the font size and color. Also add a button so the user
    > can close the form (drag&drop the button to the form, double click on it and
    > add this line of code:
    >
    > Unload Me
    >
    > (this will unload and close the form when you click on the button).
    >
    > Finally, go to the Workbook_Opened event and add this line:
    >
    > UserForm1.Show
    >
    > (UserForm1 is the name of the form you created - you can change it in the
    > properties - click on the UserForm1 and in the Properties window find the
    > (Name) property).
    >
    > Hope this helps.
    > --
    > Best regards,
    > Peter Jaušovec
    > http://blog.jausovec.net
    > http://office.jausovec.net
    >
    >
    > "Sheila" je napisal:
    >
    > > Thanks Peter this is exactly what I was looking for. Is it possible to change
    > > the size and color of this message?
    > >
    > > "Peter Jausovec" wrote:
    > >
    > > > Hi Sheila,
    > > >
    > > > You need to create a new macro (ALT+F11) and add a Workbook_Opened event (on
    > > > the left side click on ThisWorkbook; a new window will open and in left
    > > > dropdown select Workbook and Workbook_Opened will be added). Next, you just
    > > > add this line (between Private Sub Workbook_Opened() and End Sub):
    > > >
    > > > MsgBox "Complete section two before entering section one"
    > > >
    > > > Message box will be displayed when document is opened.
    > > > --
    > > > Best regards,
    > > > Peter Jaušovec
    > > > http://blog.jausovec.net
    > > > http://office.jausovec.net
    > > >
    > > >
    > > > "Sheila" je napisal:
    > > >
    > > > > I would like to display a message "Complete section two before entering
    > > > > section one" when an excel file is opened.
    > > > > Any help would be appreciated.
    > > > >
    > > > >


+ 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