Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 152
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
creating a button to activate another worksheet within a workbook Mickeyjay71 Excel Programming 7 October 31st 07 03:24 PM
activate a worksheet formula through a button TUNGANA KURMA RAJU Excel Discussion (Misc queries) 5 November 12th 05 09:28 AM
How to change Button Caption? BrianB Excel Programming 3 June 1st 05 06:24 PM


All times are GMT +1. The time now is 03:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"