Restricting activation of a form button

I'm using 2 form buttons which runs 2 different subs. The buttons are on the 
same sheet. I wish to restrict the activation of one of the 2 buttons 
(assigned to the sub below) to only authorised persons via say, a password 
prompt? which appears upon clicking the button. Grateful for an example or 
two of how this control could be done. Thanks

Sub TestReset()
Sheet8.Select
Range("D10").Value = Range("G15").Value
Range("D11").Value = Range("D15").Value
End Sub
0
Utf
1/20/2010 9:32:02 AM
excel.programming 6508 articles. 2 followers. Follow

2 Replies
777 Views

Similar Articles

[PageSpeed] 5

I would try something like this:

Sub TestRest()
    Sheet8.Select
    Dim ThePassWord As String
    Dim t As String
    t = "What's the password"
    ThePassWord = InputBox(prompt:=t)
    If UCase(ThePassWord) = "BATTLEFIELD" Then
        Range("D10").Value = Range("G15").Value
    Else
        MsgBox "That is incorrect."
    End If
End Sub


The password would be BATTLEFIELD in this example

"Max" wrote:

> I'm using 2 form buttons which runs 2 different subs. The buttons are on the 
> same sheet. I wish to restrict the activation of one of the 2 buttons 
> (assigned to the sub below) to only authorised persons via say, a password 
> prompt? which appears upon clicking the button. Grateful for an example or 
> two of how this control could be done. Thanks
> 
> Sub TestReset()
> Sheet8.Select
> Range("D10").Value = Range("G15").Value
> Range("D11").Value = Range("D15").Value
> End Sub
0
Utf
1/20/2010 2:51:02 PM
Thanks, Cerberus. How could it be re-expressed the other way around, ie 
check the password, then exit sub immediately (with the error msg) if 
password is incorrect? 


0
Max
1/20/2010 10:59:36 PM
Reply:

Similar Artilces:

Open and close a second instance of a form?
I have a Suppliers table and corresponding form on which we hold all the details of the companies that supply us with materials. Some of these have head offices and branch offices, whose details we need to access from time to time. So those other companies have been added to the Suppliers table. I created a field and control named Suppliers.LinkedCompany. The control is a combo so that users can look up and select the relevant record. Then I coded the double-click event on the combo control so that users could hop into any supplier's linked company and that's fine, it opens the S...

Restricting Input
Ok, I'm on a roll here. Could someone please tell me how to set up a cell restriction that will only allow data input if another cell is "empty" or has a certain value? Kind of like an IF function, only when "true" exists, I can input any value, and when "false" exists, I must leave it blank. Thanks in advance. Randy, you can accomplish this using data validation. Select: data-validation, then input your restriction. Randy Vieira wrote: > Ok, I'm on a roll here. Could someone please tell me how to set up a cell > restriction that will ...

How to change CFileDialog Open button text
Using VC++ 6.0... I want to use the CFileDialog to allow the user to select a file to delete. I would like to change the text of the "Open" button to "Delete". Is there an easy way to do that, or do I need to go the route of creating a new dialog template based on the common dialog and add a button there? ....mcs Meade, You can derive from CFileDialog and do all kind of stuff in the class. Johan Rosengren Abstrakt Mekanik AB "Meade Swenson" <meade@ieee.org> a �crit dans le message de news:uxrqLzn8EHA.3820@TK2MSFTNGP11.phx.gbl... > Using VC++ ...

Restrict calendar?
We are currently looking at moving to Exchange 2003 this year. Our employers are holding off on the purchase due to the fact that there is no way to restrict certain users from even being able to see "Free/Busy" on their calendars. They want it so that a whole Active Directory OU can be set to not have any calendar access to another OU's calendar. Does anyone know if this is possible? This is huge for us so a great big Thank You in advance to those who might have suggestion. sgsundqu wrote: > We are currently looking at moving to Exchange 2003 this year. Our > employe...

Pricing restriction to price lists
Most of our customers do no wish to load all products to MS CRM. Therefore the system restriction to use price lists is too inflexible. In case of opportunities it is even not possible to enter manual prices on product level. ...

Restrictions
All of a sudden I am no longer able to click on hyperlinks embedded within email and get an error message "THIS OPERATION HAS BEEN CANCELLED DUE TO RESTRICTION IN EFFECT ON THIS COMPUTER. PLEASE CONTACT YOUR SYSTEM ADMINISTRATOR." I haven't knowingly changed anything but some other program may have. How do I get back to normal? See if the articles at http://support.microsoft.com/?kbid=3D310049 and http://support.microsoft.com/?kbid=3D307818 help with this.=20 --=20 Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for=20 Administrator...

I am studying microsoft, it says hit the practice button , where .
I can't find the practice button in outlook 2003 -- p120mb "p120mb" <p120mb@discussions.microsoft.com> wrote in message news:3AF357EC-85F6-465F-ACAF-09861254DD3D@microsoft.com... >I can't find the practice button in outlook 2003 Nor can we....;-) -- Asking a question? Please tell us the version of the application you are asking about, your OS, Service Pack level and the FULL contents of any error message(s) There is no practice button. Maybe its on the program you are using - click practice to pause the lesson? -- Diane Poremsky [MVP - Outlook] Outlook T...

Requery at Got Focus or Activate?
I put Me.Requery on the form's "On Got Focus" event, but that did not work. I put Me.Requery on the form's "On Activate" event and that does work. I want the form to Requery itself each time it displays. The "On Activate" seems to do the trick if the form is started normally or when it is started with: DoCmd.OpenForm stDocName, , , stLinkCriteria (for a specific key). Is there a flaw in this approach? -JHC ...

Excel
I use buttons in a spreadsheet to do certain tasks, I want a button to switch between the following entries in one cell. The entries are W,2,4,Q,M. Is there some simple VB code that I can add to the button to switch between these values. Thanks in Advance. One way: Option Explicit Sub testme02() 'W,2,4,Q,M. With ActiveCell Select Case UCase(.Value) Case Is = "W": .Value = 2 Case Is = 2: .Value = 4 Case Is = 4: .Value = "Q" Case Is = "Q": .Value = "M" Case Else: .Value...

remove name from comment form
my computer user name appears automatically in every comment form (right click on cell>insert comment). i have tried deleting computer registration, but it hasn't changed. i don't want to see my name in every comment . it's pointless. where in the registry (or elsewhere) can i go to delete it? so that i can start with a blank comment. tia jeffrey Debra Dalgleish has some neat stuff for comments at: http://www.contextures.com/xlcomments03.html (I really like the one about changing your user name to Note. Then when the name gets added, it looks like it's there for...

hide activities
Hi, I'd like to hide the service appointment and campaign response activities options when I want to create a new activity. I was change the dlg_create.aspx file and comment the render list item. I don't like the idea to manipulate this file, and I want to know if is possible to hide this options in other way. thanks -- Magy yes you can hid see your id's document.all.navContacts.style.display = "none"; -- Regards, MS CRM Certified Professional http://microsoftcrm3.blogspot.com Chat with me on MSN / Gmail / Skype : ID Is :.. mscrmexpert@gmail.com "...

Restrict DB Access
Is there a way in GP7.5 to restrict a user to only see a single SQL Database/Server when they login to GP? Thanks It's unclear exactly what you want to do. In GP, you can restrict access by user to the company databases via the User Access window. When you set up the ODBC DSN, you are determing which database server the user can access through GP. Additionally, if you happen to have multiple servers, the best way to handle it is to have different user accounts. -- Charles Allen, MVP "JDR" wrote: > Is there a way in GP7.5 to restrict a user to only see a si...

Activation in 2002
I upgraded Outlook to Outlook 2002 on my desktop with an upgrade that came with my iPAQ Pocket PC. I then proceeded to "activate" it. Now I'm trying to use my laptop to sync with my Pocket PC but I can't "activate" Outlook 2002 again, because it says it has already been activated once, I want to drop the activation from my desktop and move it to my laptop. Anypone with advice??? Use the telephone method to activate Outlook on the laptop. -- Milly Staples [MVP - Outlook] Post all replies to the group to keep the discussion intact. Having searched th...

Change the DataMode of a Form (?)
I'd like a form to open in the "Add" mode, but I'd like to have a button for changing into the "Edit" mode when desired. Is there a better way to do this than re-opening the form? -- Thanks, croy The normal way for opening a form is DoCmd.OpenForm "student details", acNormal, , , acFormAdd But i guess you know that already. If you mean that you want to edit records you can adjust this to DoCmd.OpenForm "student details", acNormal, , , acFormEdit That way the users see the records where they can edit records. is that wha...

Frx webport and active directory
FRx Webport should be synced with active directory ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en-us/default.mspx?mid=b82db530-229f-42b3-89bf-0ff225d89a58&dg=microsoft.public.greatplains ...

Display Form only!
Hi All, I'm developing a form which I'm hoping will act as the only interfac the intended users will need to use. With som help from the forum I'v solved most of the problems I forsaw and am now trying to tart th thing into it's final presentation state. My question for those the forum is :- Can you hide excel, worksheet etc, leaving only the form on screen? Thankx for your thoughts Noggi -- Message posted from http://www.ExcelForum.com Hi You can use this events in the Form Private Sub UserForm_Initialize() With Application ..Visible = False Me.Top = .Top Me.Le...

Combo Box on Form does not save correctly to table
I got a combo box on my form. The combo box lists our suppliers. When I save the form and check the table to ensure the info was stored properly, it shows the Supplier ID in the column instead of the name. I have deleted and rerun this combo box a dozen times and can not fiqure out where my error is. I have another form that I created with the combo box listing the suppliers using the same table. That second form saves the supplier info correctly. I have looked at properties in both forms to see if I see the problem, but I do not. Can someone please help me? -- Bandit Assuming...

Can't activate Office:Mac 2008 trial
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel I downloaded the trial version of Microsoft Office 2008, got all the way installed, tried to open Excel (and Word), it asks again for the Product Key, this time I get the message, "You have entered an invalid product key. Please try again." I've downloaded twice and both times wind up with the same problem. Can you help me? Hi Bob, Here's a quick troubleshooting guide for you. Hope this helps. Product Key Entry Issues Ensure that you have entered the 25 character product key (i.e. ABCDE-FGHIJ-KLMNO-P...

Command Button Protection
I have a command button on my worksheet that is connected to a macro that sorts data in the worksheet. I want to be able to protect the command button so that user's can't change the text, macro that is assigned to it, etc. Help is appreciated! Can you protect the worksheet? You might have to add some unprotect code and reprotect code to your macro, though. (and unlock some cells???) Mark1 wrote: > > I have a command button on my worksheet that is connected > to a macro that sorts data in the worksheet. I want to be > able to protect the command button so that u...

Service Activities
We would like Appointments/Service Activities to show up in Outlook Web Access for our tech's so they can check for new appointments/service activities throughout the day. The problem as I understand it is, if they have their laptops with them, there is no way for Outlook to get updates from CRM (short of VPN) and so OWA wouldn't be current. Does anyone know of a way whereby our Dispatcher could schedule a service call or appointment and it would show up in OWA even though their laptops/CRM Outlook clients were disconnected from the network? Thanks, Neil ...

Template form security issue
Hi I have created an order form in Excel 2000 on my pc on the network drive and saved it as a Template - I protected certain cells and now I have moved to other pcs in the company and am locating it on the server and trying to shortcut it to the other users. Each time the other users open this template they are getting a security warning. I have tried to go back to the original template but have noticed that the security on my pc is already Low. How can I overcome this problem??? Thanks in advance Ann Ireland If this is a macro warning, then the setting belongs with each user. E...

Restricting no. of recipients
Hello, We are using Exchange 5.5 server now and for some reason, we need to restrict the number of recipients that an user can send at once. I tried to find at most of configuration dialogs, but could not find it. Is it possible to enable this function in Exchange 5.5? Or is there a 3rd party tool regarding this? Appreciate it if you can find it or help me. Thanks. Richard You can set this, but it is for the maximum number of recipients in the message before distribution list expansion, so a distribution list counts as one recipient. It is much more accurate in Exchange 2000/2003....

form to enter Silent Auction data?
Does anyone have a form already set up to enter data for a silent auction? If so, how did you go about using it at check-out time? ...

What happened to the New Form Dialog box; are there still autoform
...

restricting the drop lines to only a single series
I have mutiple-series charts, but would like restric the drop lines only to only one (ususlly the first) plotted data series. However, the drop line option seems to apply to ALL data series and creates an unreadable mess. Is there a way to see only what I want, i.e. the drop lines for a selected series only? z.entropic Hi Z, > I have mutiple-series charts, but would like restric the drop lines only to > only one (ususlly the first) plotted data series. However, the drop line > option seems to apply to ALL data series and creates an unreadable mess. > > Is there a way...