Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change Worksheet Button Caption on Worksheet.Activate
Like the title says....
I want to change the text on a worksheet button when I activate the sheet. I know how to do it in a dialog box but don't have a clue where to start. In short, I have a list of projects in a column and have a button above the column. I have a cell that counts how many projects I list in a range. I'd like to have the button say something like: "Summarize X Projects" where "X" is the count of the projects and gets updated with the correct quantity whenever I add a project to the list. Part of my problem is that I have no idea how to find out the name of the button so I can call it so any resource explaining those kinds of things would help. Thanks, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change Worksheet Button Caption on Worksheet.Activate
It depends. There are two types of command buttons.
For a button created using the Forms toolbar, Ctrl+Click it or Right+Click it to select it. The name of the button will be in the Name box at the top left of the screen, where you can change it if you wish. Use code like the following to change the caption of a button named Button 1 in Sheet1: Sheet1.Buttons("Button 1").Caption = "XXX" For a button created with the Control Toolbox toolbar, click the Design Mode button on the Control Toolbox toolbar to enter design mode. Right+Click the button and select Properties to see the buttons name and edit it if you wish. You can then use code like the following to change the caption on a button named CommandButton1 in Sheet1: Sheet1.CommandButton1.Caption = "New Test" John Green "MikeZz" wrote in message ... Like the title says.... I want to change the text on a worksheet button when I activate the sheet. I know how to do it in a dialog box but don't have a clue where to start. In short, I have a list of projects in a column and have a button above the column. I have a cell that counts how many projects I list in a range. I'd like to have the button say something like: "Summarize X Projects" where "X" is the count of the projects and gets updated with the correct quantity whenever I add a project to the list. Part of my problem is that I have no idea how to find out the name of the button so I can call it so any resource explaining those kinds of things would help. Thanks, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
creating a button to activate another worksheet within a workbook | Excel Programming | |||
activate a worksheet formula through a button | Excel Discussion (Misc queries) | |||
How to change Button Caption? | Excel Programming |