Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Warning Message before a Macro is Run
Is there a way to have a warning message pop-up before a macro is
applied (i.e., once you press the macro button, the warning will appear and ask for a second confirmation of the process before it starts...)? Thanks. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Warning Message before a Macro is Run
The following code will ask the user if they want to continue, and if
they choose not to, it will end the macro. This needs to be placed at the top of the macro when you "edit" the macro. If you need help doing that, write back. if msgbox("Are you sure that you want to run this macro?",vbyesno, "Are you sure?") = vbno then exit sub end if On Dec 11, 10:06 pm, "amirstal" wrote: Is there a way to have a warning message pop-up before a macro is applied (i.e., once you press the macro button, the warning will appear and ask for a second confirmation of the process before it starts...)? Thanks. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Warning Message before a Macro is Run
Thanks Brian,
It did not work... Here is how I tried: Sub cleanblotter() ' ' cleanblotter Macro ' Macro recorded 12/11/2006 by Reuters LTD ' ifmsgbox("Are you sure that you want to clean the blotter?",vbyesno,"Are you sure?")=vbno then Exit Sub End If Range("AN19").copy Range("AL19").PasteSpecial xlPasteValues Range("A11:A1000,B11:B1000,D11:D1000,E11:E1000,G11 :G1000,I11:I1000,J11:J1000,K11:K1000").Select Range("I11").Activate Selection.ClearContents Range("A11").Select End Sub Amir Brian wrote: The following code will ask the user if they want to continue, and if they choose not to, it will end the macro. This needs to be placed at the top of the macro when you "edit" the macro. If you need help doing that, write back. if msgbox("Are you sure that you want to run this macro?",vbyesno, "Are you sure?") = vbno then exit sub end if On Dec 11, 10:06 pm, "amirstal" wrote: Is there a way to have a warning message pop-up before a macro is applied (i.e., once you press the macro button, the warning will appear and ask for a second confirmation of the process before it starts...)? Thanks. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Warning Message before a Macro is Run
amirstal wrote: Thanks Brian, It did not work... Here is how I tried: Sub cleanblotter() ' ' cleanblotter Macro ' Macro recorded 12/11/2006 by Reuters LTD ' ifmsgbox("Are you sure that you want to clean the blotter?",vbyesno,"Are you sure?")=vbno then Exit Sub End If Range("AN19").copy Range("AL19").PasteSpecial xlPasteValues Range("A11:A1000,B11:B1000,D11:D1000,E11:E1000,G11 :G1000,I11:I1000,J11:J1000,K11:K1000").Select Range("I11").Activate Selection.ClearContents Range("A11").Select End Sub Amir Brian wrote: The following code will ask the user if they want to continue, and if they choose not to, it will end the macro. This needs to be placed at the top of the macro when you "edit" the macro. If you need help doing that, write back. if msgbox("Are you sure that you want to run this macro?",vbyesno, "Are you sure?") = vbno then exit sub end if On Dec 11, 10:06 pm, "amirstal" wrote: Is there a way to have a warning message pop-up before a macro is applied (i.e., once you press the macro button, the warning will appear and ask for a second confirmation of the process before it starts...)? Thanks. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Warning Message before a Macro is Run
Sub cleanblotter()
' ' cleanblotter Macro ' Macro recorded 12/11/2006 by Reuters LTD ' If MsgBox("Are you sure that you want to clean the blotter?", _ vbyesno,"Are you sure?")=vbno then Exit Sub Range("AN19").copy Range("AL19").PasteSpecial xlPasteValues Range("A11:A1000,B11:B1000,D11:D1000,E11:E1000,G11 :G1000,I11:I1000,J11:J1000,K11:K1000").ClearConten ts Range("A11").Select End Sub -- --- HTH Bob (change the xxxx to gmail if mailing direct) "amirstal" wrote in message ups.com... Thanks Brian, It did not work... Here is how I tried: Sub cleanblotter() ' ' cleanblotter Macro ' Macro recorded 12/11/2006 by Reuters LTD ' ifmsgbox("Are you sure that you want to clean the blotter?",vbyesno,"Are you sure?")=vbno then Exit Sub End If Range("AN19").copy Range("AL19").PasteSpecial xlPasteValues Range("A11:A1000,B11:B1000,D11:D1000,E11:E1000,G11 :G1000,I11:I1000,J11:J1000,K11:K1000").Select Range("I11").Activate Selection.ClearContents Range("A11").Select End Sub Amir Brian wrote: The following code will ask the user if they want to continue, and if they choose not to, it will end the macro. This needs to be placed at the top of the macro when you "edit" the macro. If you need help doing that, write back. if msgbox("Are you sure that you want to run this macro?",vbyesno, "Are you sure?") = vbno then exit sub end if On Dec 11, 10:06 pm, "amirstal" wrote: Is there a way to have a warning message pop-up before a macro is applied (i.e., once you press the macro button, the warning will appear and ask for a second confirmation of the process before it starts...)? Thanks. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro Warning Message | Excel Discussion (Misc queries) | |||
Macro Warning Message | Excel Discussion (Misc queries) | |||
Stopping the Macro Warning Message | Excel Programming | |||
Stoping the Macro Warning Message | Excel Discussion (Misc queries) | |||
On Close Macro - stop warning message | Excel Programming |