Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 88
Default Restricting activation of a form button

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Restricting activation of a form button

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?


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom button behaviour (activation and deactivation) David Torrejón Excel Programming 3 July 11th 07 10:59 AM
excel form activation in macro? dr chuck Excel Programming 2 August 9th 06 07:21 AM
form activation? dr chuck Excel Programming 0 August 6th 06 10:32 PM
"combination drop-down edit " form activation in Excel Trev Excel Discussion (Misc queries) 1 March 4th 05 03:26 AM
change of button properties upon activation Jos reulen Excel Programming 1 November 17th 03 04:44 PM


All times are GMT +1. The time now is 01:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"