View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
[email protected][_2_] thesquirrel@gmail.com[_2_] is offline
external usenet poster
 
Posts: 39
Default 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.