Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
how do i set up a user prompt at the start of an excel workbook ?
I need to create a security feature which requests the users agreement prior
to entering into a worksheet. How do I do that? |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
how do i set up a user prompt at the start of an excel workbook ?
Mark,
Right click the sheet tab of the sheet you want to protect, View code and paste the code below in. Change the ProtectedSheet to the correct sheet name and the outsheet variable to where you want to go if the user doesn't agree. A couple of points. If macros aren't enabled it won't work and it provides very little security because Excel security is weak. Private Sub Worksheet_Activate() msg = "Do you agree to the terms and conditions. Y/N?" ttl = "User Agreement" Set ProtectedSheet = Sheets("Sheet1") 'Change to suit Set OutSheet = Sheets("Sheet2") 'Change to suit ProtectedSheet.Visible = False response = MsgBox(msg, vbYesNo, ttl) Application.EnableEvents = False If response = vbYes Then ProtectedSheet.Visible = True ProtectedSheet.Activate Else OutSheet.Activate ProtectedSheet.Visible = True End If Application.EnableEvents = True End Sub -- Mike When competing hypotheses are otherwise equal, adopt the hypothesis that introduces the fewest assumptions while still sufficiently answering the question. "Mark" wrote: I need to create a security feature which requests the users agreement prior to entering into a worksheet. How do I do that? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Prompt user on automatic updates for Workbook Links | Excel Discussion (Misc queries) | |||
start up prompt for updating links | Excel Discussion (Misc queries) | |||
How prompt Excel user to fill cell with text, i.e., proposal name | Excel Discussion (Misc queries) | |||
save prompt for user exit, but no save prompt for batch import? | Excel Discussion (Misc queries) | |||
how do I prompt a user to update a cell in Excel? | Excel Discussion (Misc queries) |