If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > How can you create a MessageBox in Excel like in Access?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 08-18-04, 13:58
Bud Bud is offline
Registered User
 
Join Date: Dec 2003
Location: Dallas, TX
Posts: 995
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
Reply With Quote
  #2 (permalink)  
Old 08-18-04, 15:17
DavidCoutts DavidCoutts is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 08-18-04, 17:42
shades shades is offline
Registered User
 
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
Reply With Quote
  #4 (permalink)  
Old 08-18-04, 21:19
savbill savbill is offline
Registered User
 
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
Reply With Quote
  #5 (permalink)  
Old 08-19-04, 13:58
Bud Bud is offline
Registered User
 
Join Date: Dec 2003
Location: Dallas, TX
Posts: 995
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On