Computing.Net > Forums > Programming > Locking Buttons in Excel VBA

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Locking Buttons in Excel VBA

Reply to Message Icon

Name: AJJ
Date: October 17, 2005 at 06:06:38 Pacific
OS: WinXP
CPU/Ram: 2800XP / 1GB
Comment:

In an excel worksheet, I have 10 individual command buttons that perform a calculation. However, I was also looking to add another button to the sheet called Deactivate, which either locks or renders the 10 buttons inactive until another button "Activate" is clicked.

Is there a way of achieving this? I looked at the CommandButton.Locked command but this doesn't seem to alter their behaviours.

Thanks in advance for your help.

AJ



Sponsored Link
Ads by Google

Response Number 1
Name: StuartS
Date: October 17, 2005 at 12:19:46 Pacific
Reply:

In ButtonClick event of the Activate or Deactivate buttons insert a command to Enable or Disable the other ten buttons.


CommandButton1.Enabled = False

or

CommandButton1.Enabled = True

The locked command only works if you have a protected spreadsheet. Works the same as locking a cell, group of cells or an entire worksheet so that it cannot be altered. Look under protection in the tools menu.

Stuart


0

Response Number 2
Name: AJJ
Date: October 17, 2005 at 15:01:01 Pacific
Reply:

Thanks for that Stuart!

Got it working now.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


VB Custom Buttons VBScript Active Directory...



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Locking Buttons in Excel VBA

How start an VBA appl from excel? www.computing.net/answers/programming/how-start-an-vba-appl-from-excel/13090.html

programming a cue setup, with VBA www.computing.net/answers/programming/programming-a-cue-setup-with-vba/10437.html

help in excel (office xp) www.computing.net/answers/programming/help-in-excel-office-xp/945.html