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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default 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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 486
Default 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


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

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
Caption disappears from CommandButton. Ed Excel Programming 0 April 19th 05 09:23 PM
CommandButton Caption change via macro PCLIVE Excel Programming 3 September 20th 04 08:29 PM
CommandButton caption title Paul Excel Programming 1 August 5th 04 11:38 PM
Change CommandButton Caption Claude Excel Programming 4 July 16th 04 04:18 PM
CommandButton.Caption Bob Phillips[_5_] Excel Programming 0 September 8th 03 08:15 AM


All times are GMT +1. The time now is 07:58 PM.

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

About Us

"It's about Microsoft Excel"