Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
My suggestion would be to make a function that takes an argument and does
everything you want it to ie: Private Function MyFunction(Send as Boolean) code . . . If Send = True then code to send . . . End If code . . . End Function Then for your button Private Sub myButton_Click() If MsgBox("Do you want to send this report?", vbYesNo) = vbYes Then MyFunction Send:=TRUE Else MyFunction Send:=FALSE End If End Sub For your other code MyFunction Send:=TRUE Dan E "Tod" wrote in message ... I have something like this: If MsgBox("Do you want to send this report?", vbYesNo) = vbYes Then 'Code to send report End If When the code is being executed from a button on the worksheet, it will give the user the choice. However, I also have a script that opens this workbook each morning and runs the same procedure. Is there a way I can have the procedure know it's being run by a script and accept the default (which I think is Yes)? tod |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
msgbox | Excel Worksheet Functions | |||
VB - ignore a msgbox prompt | Excel Discussion (Misc queries) | |||
msgbox | Excel Discussion (Misc queries) | |||
msgbox | Excel Discussion (Misc queries) | |||
Help with MsgBox... | Excel Worksheet Functions |