+ Reply to Thread
Results 1 to 5 of 5

Msgbox

  1. #1
    Registered User
    Join Date
    09-08-2009
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    74

    Msgbox

    Hi All,

    I need some assistance in creating a MsgBox when an excel spreadsheet is opened and more specifically a particular sheet is opened.

    I'd like the Msgbox to say "Do not forget to select frequency in the blue shaded fields."

    I have read a guide which says just add a module in the spreadsheet eg.

    PHP Code: 
    Sub Msgbox ()

    Msgbox "Do not forget to select frequency in the blue shaded fields."

    End Sub 
    This does nothing and since I am a beginner to vba, I don't know what to do.

    A little about the cell: its a Data Validation List containint (Weekly, Fortnightly, Monthly, Quarterly and Annually).

    the message should pop up either once they pass the cell OR pop up automatically as soon as that Sheet is opened.

    Thank you very much in advance
    Last edited by Jazzy Max; 10-08-2009 at 01:15 AM.

  2. #2
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2010, 2019
    Posts
    40,689

    Re: Msgbox

    Please edit your post to add code tags.

    Thanks.
    Entia non sunt multiplicanda sine necessitate

  3. #3
    Registered User
    Join Date
    09-08-2009
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    74

    Re: Msgbox

    Quote Originally Posted by shg View Post
    Please edit your post to add code tags.

    Thanks.
    sorry about that, I didn't know such tags were to be used. Anyway, I have read the How To...? and done so.

    Thanks Shg

  4. #4
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,565

    Re: Msgbox

    Hi Jazzy Max,

    Your code is correct, but for it to work on a particular sheet (tab) it needs to be assigned to its the Worksheet_Activate event. To do this, follow these four steps:

    1. Copy (Ctrl + C) the following code to the clipboard:
    Please Login or Register  to view this content.
    2. Right click on the tab name you wish to assign the code to and from the shortcut menu select View Code
    3. Paste (Ctrl + V) the code from step 1 into the blank VBA module
    4. From the File menu select Close and Return to Microsoft Excel

    HTH

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  5. #5
    Registered User
    Join Date
    09-08-2009
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2007
    Posts
    74

    Re: Msgbox

    Thank you so much...
    Last edited by Jazzy Max; 10-08-2009 at 01:15 AM.

+ 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