+ Reply to Thread
Results 1 to 7 of 7

Commandbutton caption change

  1. #1
    Forum Contributor
    Join Date
    12-16-2005
    Posts
    161

    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)

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259
    Hello Peter,

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

    Sincerely,
    Leith Ross

  3. #3
    Dave Peterson
    Guest

    Re: 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

  4. #4
    Jim Thomlinson
    Guest

    RE: 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. #5
    Forum Contributor
    Join Date
    12-16-2005
    Posts
    161
    Leith,

    Toolbox

  6. #6
    Jim Thomlinson
    Guest

    Re: 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. #7
    Forum Contributor
    Join Date
    12-16-2005
    Posts
    161

    Thanks

    Thanks everyone, I now have this nailed!

    Cheers

    Peter (new to VBA)

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1