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
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.
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
Summary: Hi guyz, I have written an application that formats an excel sheet and exports data into text files. Now, I have created a command bar button in excel, but I haven't found the code to start the user f...
Summary: W-Fred is right. About programming. Yes you can do it in Excel VBA Better do it in Access and put a neat frontend. Else put values in cell and identify them as N=workbook(xyz).worksheet(Sheet1).Cells...
Summary: Try these two lines: Rows("1:1").Copy Windows("Book2").Range("A1").PasteSpecial Paste:=xlValues, Transpose:=True The operation to convert between horizontal and vertical is "Transpose:=True" If you do...