ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Commandbutton caption change (https://www.excelbanter.com/excel-programming/348487-commandbutton-caption-change.html)

peter.thompson[_6_]

Commandbutton caption change
 

Still having problems with this.

I have a number of commandbuttons on a sheet that open up userforms.

Once the user has opened the form, i want the user to be able to change
the commandbutton caption, by entering the new caption into a text box.


The form textbox data is loaded into a sheet by the use of an 'Enter'
commabnbutton on the form

Any help welcome!

Peter (new to VBA)


--
peter.thompson
------------------------------------------------------------------------
peter.thompson's Profile: http://www.excelforum.com/member.php...o&userid=29686
View this thread: http://www.excelforum.com/showthread...hreadid=494721


Dave Peterson

Commandbutton caption change
 
I put a commandbutton on Sheet1 and used this code behind the Ok button on a
userform:

Option Explicit
Private Sub CommandButton1_Click()
Worksheets("Sheet1").CommandButton1.Caption = Me.TextBox1.Value
End Sub




"peter.thompson" wrote:

Still having problems with this.

I have a number of commandbuttons on a sheet that open up userforms.

Once the user has opened the form, i want the user to be able to change
the commandbutton caption, by entering the new caption into a text box.

The form textbox data is loaded into a sheet by the use of an 'Enter'
commabnbutton on the form

Any help welcome!

Peter (new to VBA)

--
peter.thompson
------------------------------------------------------------------------
peter.thompson's Profile: http://www.excelforum.com/member.php...o&userid=29686
View this thread: http://www.excelforum.com/showthread...hreadid=494721


--

Dave Peterson

Leith Ross[_398_]

Commandbutton caption change
 

Hello Peter,

Which type of Command Button are you using on the Worksheet? Forms or
Control Toolbox?

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=494721


Jim Thomlinson[_5_]

Commandbutton caption change
 
These command buttons, did they come from the Forms toolbar or from the
control toolbox. They are different and the solution will have to be tailored
to the button type that you have.
--
HTH...

Jim Thomlinson


"peter.thompson" wrote:


Still having problems with this.

I have a number of commandbuttons on a sheet that open up userforms.

Once the user has opened the form, i want the user to be able to change
the commandbutton caption, by entering the new caption into a text box.


The form textbox data is loaded into a sheet by the use of an 'Enter'
commabnbutton on the form

Any help welcome!

Peter (new to VBA)


--
peter.thompson
------------------------------------------------------------------------
peter.thompson's Profile: http://www.excelforum.com/member.php...o&userid=29686
View this thread: http://www.excelforum.com/showthread...hreadid=494721



peter.thompson[_7_]

Commandbutton caption change
 

Leith,

Toolbo

--
peter.thompso
-----------------------------------------------------------------------
peter.thompson's Profile: http://www.excelforum.com/member.php...fo&userid=2968
View this thread: http://www.excelforum.com/showthread.php?threadid=49472


Jim Thomlinson[_5_]

Commandbutton caption change
 
Assuming that the command button is on Sheet1 (Code Name) and you added a
command button without changing the Name.

Sheet1.Commandbutton1.Caption = "Tada"
--
HTH...

Jim Thomlinson


"peter.thompson" wrote:


Leith,

Toolbox


--
peter.thompson
------------------------------------------------------------------------
peter.thompson's Profile: http://www.excelforum.com/member.php...o&userid=29686
View this thread: http://www.excelforum.com/showthread...hreadid=494721



peter.thompson[_9_]

Commandbutton caption change
 

Thanks everyone, I now have this nailed!

Cheers

Peter (new to VBA

--
peter.thompso
-----------------------------------------------------------------------
peter.thompson's Profile: http://www.excelforum.com/member.php...fo&userid=2968
View this thread: http://www.excelforum.com/showthread.php?threadid=49472



All times are GMT +1. The time now is 08:49 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com