Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
add a warning before running a macro
i have recorded a macro that clears the contents of the unprotected unlock
cells. i would like to have a message asking if the user is sure that they want to clear the contents or not to. is this possible? |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
add a warning before running a macro
Option Explicit
Sub YourMacHere() Dim resp as long resp = msgbox(prompt:="Are you sure?", buttons:=vbyesno) if resp = vbno then exit sub end if 'rest of your code End Sub Picman wrote: i have recorded a macro that clears the contents of the unprotected unlock cells. i would like to have a message asking if the user is sure that they want to clear the contents or not to. is this possible? -- Dave Peterson |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
add a warning before running a macro
thanks Dave, sorry i'm not all that experienced with these kinds of
modifications, how would i implement your code? "Dave Peterson" wrote: Option Explicit Sub YourMacHere() Dim resp as long resp = msgbox(prompt:="Are you sure?", buttons:=vbyesno) if resp = vbno then exit sub end if 'rest of your code End Sub Picman wrote: i have recorded a macro that clears the contents of the unprotected unlock cells. i would like to have a message asking if the user is sure that they want to clear the contents or not to. is this possible? -- Dave Peterson |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
add a warning before running a macro
You have existing code for your macro, right?
You'd copy the guts that I wrote and paste it into your procedure--right near the top, before anything really important. Dim resp as long resp = msgbox(prompt:="Are you sure?", buttons:=vbyesno) if resp = vbno then exit sub end if Are the only lines you'd want to paste (without those symbols, of course). Picman wrote: thanks Dave, sorry i'm not all that experienced with these kinds of modifications, how would i implement your code? "Dave Peterson" wrote: Option Explicit Sub YourMacHere() Dim resp as long resp = msgbox(prompt:="Are you sure?", buttons:=vbyesno) if resp = vbno then exit sub end if 'rest of your code End Sub Picman wrote: i have recorded a macro that clears the contents of the unprotected unlock cells. i would like to have a message asking if the user is sure that they want to clear the contents or not to. is this possible? -- Dave Peterson -- Dave Peterson |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
add a warning before running a macro
That worked perfectly, thanks very much
"Dave Peterson" wrote: You have existing code for your macro, right? You'd copy the guts that I wrote and paste it into your procedure--right near the top, before anything really important. Dim resp as long resp = msgbox(prompt:="Are you sure?", buttons:=vbyesno) if resp = vbno then exit sub end if Are the only lines you'd want to paste (without those symbols, of course). Picman wrote: thanks Dave, sorry i'm not all that experienced with these kinds of modifications, how would i implement your code? "Dave Peterson" wrote: Option Explicit Sub YourMacHere() Dim resp as long resp = msgbox(prompt:="Are you sure?", buttons:=vbyesno) if resp = vbno then exit sub end if 'rest of your code End Sub Picman wrote: i have recorded a macro that clears the contents of the unprotected unlock cells. i would like to have a message asking if the user is sure that they want to clear the contents or not to. is this possible? -- Dave Peterson -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro warning - how to delete macro | Excel Worksheet Functions | |||
Get Macro warning, but can't find Macro | Excel Worksheet Functions | |||
Macro Warning | New Users to Excel | |||
Macro warning box | Excel Discussion (Misc queries) | |||
macro warning | New Users to Excel |