Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
msgbox question
In my marco, I want to show a message box to ask " do you have open the
1244.xls file" and to show two button " yes" and "no" for user select. If user select "yes", my marco will go on, select "no", it will quit the marco |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
msgbox question
Hi,
You only need to check the No button response = MsgBox("Have you opened 1244.xls?", vbYesNo, "Your Title") If response = vbNo Then Exit Sub Mike "Wu" wrote: In my marco, I want to show a message box to ask " do you have open the 1244.xls file" and to show two button " yes" and "no" for user select. If user select "yes", my marco will go on, select "no", it will quit the marco |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
msgbox question
Hi,
You may want to consider another method that doesn't rely on the user who could prees the wrong button. This checks if the workbook is open and exits the sub if it isn't. Sub marine() fname = "1244.xls" On Error Resume Next Workbooks(fname).Activate If Err < 0 Then MsgBox "You must have workbook " & fname & " open to continue. Exiting" Exit Sub 'Workbook isn't open End If Err.Clear 'Clear errors End Sub Mike "Mike H" wrote: Hi, You only need to check the No button response = MsgBox("Have you opened 1244.xls?", vbYesNo, "Your Title") If response = vbNo Then Exit Sub Mike "Wu" wrote: In my marco, I want to show a message box to ask " do you have open the 1244.xls file" and to show two button " yes" and "no" for user select. If user select "yes", my marco will go on, select "no", it will quit the marco |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
msgbox in VBA | Excel Discussion (Misc queries) | |||
msgbox | Excel Discussion (Misc queries) | |||
msgbox | Excel Discussion (Misc queries) | |||
MsgBox | Excel Discussion (Misc queries) | |||
Msgbox | Excel Worksheet Functions |