Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Unanswered: How can you create a MessageBox in Excel like in Access?

    Hi,

    I am trying to figure out how to create a MessageBox in Excel 2000 just like you create one in Access2000, but have no real knowledge of this kinda thing in Excel. What I was trying to do was when the user input certain data, if it met a particular criteria it would then popup a message box. If you have any knowledge I would appreciate your sharing with me, in very basic terms that is.

    thanks,
    Bud

  2. #2
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    Hi Bud

    to do this you need to look at the Worksheet_Change Event then in the code do something like

    If Target.Value = "Something" then
    'Do this
    else
    'Do this
    End if

    i will go into more detail if you wan't

    Dave

  3. #3
    Join Date
    Oct 2003
    Posts
    1,091
    Simple Message Box line for code:

    Code:
        MsgBox "You made cell D1 Bold"
    If you want to check the value each time a change is made, then use as David mentioned. If part of a larger macro, you could use it in regular module with checking incorporated.
    old, slow, and confused
    but at least I'm inconsistent!

    Rich
    (retired Excel 2003 user, 3/28/2008)

    How to ask a question on forums

  4. #4
    Join Date
    Feb 2004
    Posts
    533
    For additional parameters see the Excel VB Help on the MsgBox Function.

    Example from MS VB Help:

    Dim Msg, Style, Title, Help, Ctxt, Response, MyString
    Msg = "Do you want to continue ?" ' Define message.
    Style = vbYesNo + vbCritical + vbDefaultButton2 ' Define buttons.
    Title = "MsgBox Demonstration" ' Define title.
    Help = "DEMO.HLP" ' Define Help file.
    Ctxt = 1000 ' Define topic
    ' context.
    ' Display message.
    Response = MsgBox(Msg, Style, Title, Help, Ctxt)
    If Response = vbYes Then ' User chose Yes.
    MyString = "Yes" ' Perform some action.
    Else ' User chose No.
    MyString = "No" ' Perform some action.
    End If

    ---------------
    ~

    Bill

  5. #5
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Smile

    Thanks a lot everyone, I will soon play with this and see if I get it to working. Funny, I have learned so much so easily A2K but can't seem to duplicate that knowledge in Excel. Might be back on this side again in the future.

    thanks again,
    Bud

Posting Permissions

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