Consulting

Results 1 to 6 of 6

Thread: Automatic launch of a MsgBox

  1. #1

    Automatic launch of a MsgBox

    What is the equivalent of Workbook_Open() at the worksheet level, to trigger the launch of a MsgBox upon activating a worksheet?

  2. #2
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    Worksheets actually have an Activate event.

  3. #3
    I need the MsgBox to be displayed automatically when the worksheet is activated by the user

  4. #4
    VBAX Master Norie's Avatar
    Joined
    Jan 2005
    Location
    Stirling, Scotland
    Posts
    1,831
    Location
    Well like I said use the worksheet Activate event.
    Private Sub Worksheet_Activate()
       MsgBox Me.Name
    End Sub
    Or the workbook's SheetActivate event.
    Private Sub Workbook_SheetActivate(ByVal Sh As Object)
    	MsgBox Sh.Name
    End Sub

  5. #5
    Isn't SheetActivate designed to activate a specified sheet from another location in the workbook? Is SheetActivate used in the sheet module or in a regular module?

    Here's what I'm trying to accomplish: Let's say that Sheet1 I has a number of data fields. Upon clicking on the Sheet1 tab, I want a message box to pop up telling the user what he needs to do (I prefer this to adding individual cell comments).

    Thanks for your help
    Last edited by K. Georgiadis; 06-11-2005 at 07:05 AM. Reason: additional question

  6. #6
    Hi Norie!

    I put the code in the Sheet1 Module and confirmed that it works! Thanks again...marking this "Solved"

Posting Permissions

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