ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Macro help (https://www.excelbanter.com/excel-discussion-misc-queries/144910-macro-help.html)

belvy123

Macro help
 
Hi All
I have a Macro That I use to unprotect a form in my production sheet
it is used by using CTRL U

How can I make this so if someone happens to hit these keys inadvertantly
that it will not work or will need a password to make it work??

any suggestions

Thanks

--
crunchnin numbers

Dave Peterson

Macro help
 
Option Explicit
Sub YourMacroNameHere()
Dim Resp as long
'more declares...

'before you do anything
resp = msgbox(Prompt:="You sure you want to run this?", buttons:=vbyesno)
if resp = vbno then
exit sub
end if

'rest of your code
end sub



belvy123 wrote:

Hi All
I have a Macro That I use to unprotect a form in my production sheet
it is used by using CTRL U

How can I make this so if someone happens to hit these keys inadvertantly
that it will not work or will need a password to make it work??

any suggestions

Thanks

--
crunchnin numbers


--

Dave Peterson


All times are GMT +1. The time now is 05:49 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com