Button assignament and translation in cells

G

Guest

1) Goog evening, I made a customized tool bar where I have a button that
protect a woorksheet and another button that unprotect the worksheet, so, the
user need to press a button to use the sheet and press another button when he
finishes his work.
How could I make when the user press the button the sheet become
unprotected and when he presses it again (the same button) the sheet becomes
protected??? something like the design button (and also I want to know if
it's posible when the button is on (sheet unprotected) the button
appears with other image and when is of (sheet protected) appears with his
original image

Also:

2) In order to accomplish an assignment I want to have the possibility of
using the translate option in one of my excel sheet; If I put a word in
English in cell A1, I want in cell B1 appears his meaning in Spanish, How to
accomplish this???? (logically, using the office 2003 preinstalled
dictionary)

TIA
 
J

JE McGimpsey

one way:

This will make the button looked "pressed" when the sheet is protected,
and "up" when the sheet is unprotected (you could obviously switch):

Public Sub ToggleProtection()
Const sPWORD As String = "drowssap"
Dim cbButton As CommandBarButton
Set cbButton = CommandBars("MyBar").Controls("ToggleButton")
With ActiveSheet
If .ProtectContents Then
.Unprotect Password:=sPWORD
cbButton.State = msoButtonUp
Else
.Protect Password:=sPWORD
cbButton.State = msoButtonDown
End If
End With
End Sub

Substitute your Bar/Button name.

You could also change the button's .FaceID property.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top