ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Command button wz 2 function (https://www.excelbanter.com/excel-programming/447503-command-button-wz-2-function.html)

Bakar

Command button wz 2 function
 
Hi Excel experts,
I want to have my Cmd button to use as follow
1st click protect the sheet with a password"123" already written in the macros
then 2nd click same button i got the input box to insert the password to unlock the sheet
that is Lock and Unlock sheet with same Button
also If I can have on the button "LOCK" when the sheet is unlock and "UNLOCK" whenthe sheet is locked so thet when a user see the button he/she know that the sheet is whether await Lock or Unlock

Thanks very much for your help

Don Guillett[_2_]

Command button wz 2 function
 
On Saturday, October 27, 2012 5:26:48 AM UTC-5, Bakar wrote:
Hi Excel experts,

I want to have my Cmd button to use as follow

1st click protect the sheet with a password"123" already written in the

macros

then 2nd click same button i got the input box to insert the password to

unlock the sheet

that is Lock and Unlock sheet with same Button

also If I can have on the button "LOCK" when the sheet is unlock and

"UNLOCK" whenthe sheet is locked so thet when a user see the button

he/she know that the sheet is whether await Lock or Unlock



Thanks very much for your help









--

Bakar


Here is the basic idea. Modify to suit
Sub chgtextontoggleit()
ActiveSheet.Shapes("toggleit").Select
With Selection
If .Characters.Text = "Show" Then
msg = "NO show"
Else
msg = "Show"
End If
..Characters.Text = msg
End With
Range("a1").Select
End Sub





All times are GMT +1. The time now is 01:54 PM.

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