[howto] user opens excel sheet and gets my message
VBA Telemetry pings you when your VBA projects fail
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 4 of 4

Thread: [howto] user opens excel sheet and gets my message

  1. #1
    Guest

    Default

     
    hi,

    I`m building a macro and I want to start by telling the user of the sheet that there is a macro in the sheet doing "this and that".

    how do I get this done?
    I know the MsgBox command but I can`t seem to get it to work right after the "enable macro button" is chosen by the sheet user.

    Anyone who can help me on the way a little bit?

    Thnk.
    Remi
    Holland

  2. #2
    Board Regular
    Join Date
    Feb 2002
    Location
    Perth Australia
    Posts
    1,579
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi

    Copy this snippet of code then right click your sheet tab and select View Code. Paste it in the large white area. Use Alt+F11 to return to your sheet. Gives message whenever sheet is activated.
    If your users get tired to reading it, they can switch it off by typing "OFF" in cell A1.
    Modify the message to suit your purposes.

    Private Sub Worksheet_Activate()
    If Range("A1").Value <> "OFF" Then MsgBox "Hi there! This sheet has a neat little macro button that....."
    End Sub

    Hope this helps
    Derek


  3. #3
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Sunny, spring-like Hull
    Posts
    3,339
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Put your MsgBox code in the Workbook_Open sub. To get there, open up the VB editor, right-click on the 'ThisWorkbook' entry in the Project Explorer and select 'View Code'. Left-click on the first drop-down and change it from 'General' to 'Workbook'. This will create the Workbook_Open() sub for you. Put your MsgBox code in there. Now, whenever someone opens the Workbook your message will appear.

    Edit- Heh, or use Derek's solution, sound much better

    [ This Message was edited by: Mudface on 2002-02-22 02:31 ]

  4. #4
    Guest

    Default

      
    yeah great!

    of course. thanks guys.
    remi

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