A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » Worksheet Functions
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

how do i set up a user prompt at the start of an excel workbook ?



 
 
Thread Tools Display Modes
  #1  
Old February 11th, 2010, 08:36 AM posted to microsoft.public.excel.worksheet.functions
Mark
external usenet poster
 
Posts: 1,534
Default 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  
Old February 11th, 2010, 10:04 AM posted to microsoft.public.excel.worksheet.functions
Mike H
external usenet poster
 
Posts: 8,419
Default 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?

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:38 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.