Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I have a small spreadsheet with a command button called makebusy. I also have a macro called Auto_open to automatically run whenever the worksheet is open. What I would like to have is that at startup (somehwere in the auto_open sub) to set up the caption of my button to "start". The reason is that when the button is clicked I change the caption of it, and I would like it to start by daefault as "start" whenever the sheet is opened. Any help would be appreciated. Thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I just want to add that the button is not created with Auto_open sub.
It is already in the spreadsheet. I just want to make sure that the caption is changed to "start" Thanks |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
maybe: yoursheet.makebusy.caption = "Start"
How do you change the caption in the sub that's triggered by the button? You should be able to use the same method to change it in the auto open sub, just refer to it explicitly. (instead of "me.caption" "yoursheet.makebusy.caption") Cliff Edwards |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
There are two types of buttons. Need to know what type. One is created from the Forms toolbar and the other is and ActiveX control created from the Control Toolbox toolbar. (Both look alike) Right click on the button. If you get a dialog box with a number of options including Cut, Copy Paste etc then it is a Forms button. If nothing happens or only a dotted line around just inside the perimeter, it is an ActiveX control. Let me know what type of button you have and I'll provide sample code and instructions on how to identify the button name for the code. -- Regards, OssieMac " wrote: I just want to add that the button is not created with Auto_open sub. It is already in the spreadsheet. I just want to make sure that the caption is changed to "start" Thanks |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Thanks for all the help. It is a Forms button. I used the control toolbox to create the button adn I do get all those option when right clicking on it in design mode. Under properties I gave it the name 'makebusy'. Thanks again for all the help. On Nov 21, 1:05 am, OssieMac wrote: Hi, There are two types of buttons. Need to know what type. One is created from the Forms toolbar and the other is and ActiveX control created from the Control Toolbox toolbar. (Both look alike) Right click on the button. If you get a dialog box with a number of options including Cut, Copy Paste etc then it is a Forms button. If nothing happens or only a dotted line around just inside the perimeter, it is an ActiveX control. Let me know what type of button you have and I'll provide sample code and instructions on how to identify the button name for the code. -- Regards, OssieMac " wrote: I just want to add that the button is not created with Auto_open sub. It is already in the spreadsheet. I just want to make sure that the caption is changed to "start" Thanks |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi again,
If created under the Control Toolbox it is actually an ActiveX control. You do see the dialog box if the Design mode is turned on when you right click it. With a Forms button, you don't use Design Mode and you see the dialog box simply by right clicking on the button. Anyway example of code the code is:- Sheets("Sheet1").CommandButton1.Caption = "Start" You said that you gave it the name 'makebusy'. Did you mean the Name or the Caption? They are different. In the above code CommandButton1 is the name. You can see both name and caption in Properties. If 'makebusy' is the name then your code will be:- Sheets("Sheet1").makebusy.Caption = "Start" Of course you will need to edit the sheet name to suit your sheet name. Or if it is on a userform then:- UserForm1.makebusy.Caption = "Start" Again you will need to edit the userform name to suit your userform. Hope this helps. Feel free to get back to me if you have any further problems with it. -- Regards, OssieMac " wrote: Hi, Thanks for all the help. It is a Forms button. I used the control toolbox to create the button adn I do get all those option when right clicking on it in design mode. Under properties I gave it the name 'makebusy'. Thanks again for all the help. On Nov 21, 1:05 am, OssieMac wrote: Hi, There are two types of buttons. Need to know what type. One is created from the Forms toolbar and the other is and ActiveX control created from the Control Toolbox toolbar. (Both look alike) Right click on the button. If you get a dialog box with a number of options including Cut, Copy Paste etc then it is a Forms button. If nothing happens or only a dotted line around just inside the perimeter, it is an ActiveX control. Let me know what type of button you have and I'll provide sample code and instructions on how to identify the button name for the code. -- Regards, OssieMac " wrote: I just want to add that the button is not created with Auto_open sub. It is already in the spreadsheet. I just want to make sure that the caption is changed to "start" Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Change caption of a button | Excel Worksheet Functions | |||
Copy button caption | Excel Programming | |||
Toggle Button Caption | Excel Programming | |||
How to change Button Caption? | Excel Programming | |||
Caption of a button | Excel Programming |