Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / December 2006

Tip: Looking for answers? Try searching our database.

Message box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
K1KKKA - 20 Dec 2006 23:31 GMT
i would like to place a simple yes no msg box, have tried the code i
thought worked, but not having much success,

simply want a yes no button with message,

Yes msg box closes, no file saves and closes.

Any help??????
Martin Fishlock - 21 Dec 2006 00:13 GMT
Hi Kikk ka
Try this:

sub askmsg()
if msgbox("Some message", vbYesNo)=vbNo then
 activeworkbook.close true
end if
end sub
Signature

Hope this helps
Martin Fishlock, Bangkok, Thailand
Please do not forget to rate this reply.

> i would like to place a simple yes no msg box, have tried the code i
> thought worked, but not having much success,
[quoted text clipped - 4 lines]
>
> Any help??????
Alan - 21 Dec 2006 00:25 GMT
Sub Update()
Dim Msg, Style, Title, Response
Title = "Your Message?"
Msg = "Click 'Yes' to close this message, 'No' to save the file and close "
Style = vbYesNo + vbQuestion
Response = MsgBox(Msg, Style, Title)
If Response = vbYes Then Exit Sub
ThisWorkbook.Save
ThisWorkbook.Close
End Sub

Regards,
Alan
>i would like to place a simple yes no msg box, have tried the code i
> thought worked, but not having much success,
[quoted text clipped - 4 lines]
>
> Any help??????
bony_tony - 21 Dec 2006 00:25 GMT
Might want to change that to;

Sub askmsg()
If MsgBox("Some message", vbYesNo) = vbNo Then
 ActiveWorkbook.Close True
Else
 ActiveWorkbook.Saved = True
 ActiveWorkbook.Close
End If
End Sub

If the 'Yes' is pressed on this one, it will close without saving

Tony

> i would like to place a simple yes no msg box, have tried the code i
> thought worked, but not having much success,
[quoted text clipped - 4 lines]
>
> Any help??????

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.