+ Reply to Thread
Results 1 to 5 of 5

how to apply button text from macro?

  1. #1
    David
    Guest

    how to apply button text from macro?

    Greetings and TIA for your time
    Button1 triggers Macro1. Macro1 has code to change the text on Button1
    Using a button from the 'forms' toolbar
    I've tried:ActiveSheet.Shapes("Button 1").Characters.Text = "NewText" -
    which fails.
    What code should I use?
    David

  2. #2
    Tom Ogilvy
    Guest

    Re: how to apply button text from macro?

    ActiveSheet.buttons("Button 1").Caption = "New Text"

    --
    Regards,
    Tom Ogilvy


    "David" <[email protected]> wrote in message
    news:[email protected]...
    > Greetings and TIA for your time
    > Button1 triggers Macro1. Macro1 has code to change the text on Button1
    > Using a button from the 'forms' toolbar
    > I've tried:ActiveSheet.Shapes("Button 1").Characters.Text = "NewText" -
    > which fails.
    > What code should I use?
    > David




  3. #3
    David
    Guest

    Re: how to apply button text from macro?

    Thanks Tom
    Much appreciated
    --
    David

  4. #4
    PCLIVE
    Guest

    Re: how to apply button text from macro?

    Will this also work for a CommandButton1? I've tried:

    ActiveSheet.Buttons("CommandButton1").Caption = "test"
    ActiveSheet.CommandButton("CommandButton1").Caption = "test"

    It's not working this way. What code should I be using?

    Thanks,
    Paul


    "Tom Ogilvy" <[email protected]> wrote in message
    news:%[email protected]...
    > ActiveSheet.buttons("Button 1").Caption = "New Text"
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "David" <[email protected]> wrote in message
    > news:[email protected]...
    >> Greetings and TIA for your time
    >> Button1 triggers Macro1. Macro1 has code to change the text on Button1
    >> Using a button from the 'forms' toolbar
    >> I've tried:ActiveSheet.Shapes("Button 1").Characters.Text = "NewText" -
    >> which fails.
    >> What code should I use?
    >> David

    >
    >




  5. #5
    PCLIVE
    Guest

    Re: how to apply button text from macro?

    Got it!

    ActiveSheet.CommandButton1.Caption = "test"

    Thanks anyway.

    "PCLIVE" <[email protected]> wrote in message
    news:[email protected]...
    > Will this also work for a CommandButton1? I've tried:
    >
    > ActiveSheet.Buttons("CommandButton1").Caption = "test"
    > ActiveSheet.CommandButton("CommandButton1").Caption = "test"
    >
    > It's not working this way. What code should I be using?
    >
    > Thanks,
    > Paul
    >
    >
    > "Tom Ogilvy" <[email protected]> wrote in message
    > news:%[email protected]...
    >> ActiveSheet.buttons("Button 1").Caption = "New Text"
    >>
    >> --
    >> Regards,
    >> Tom Ogilvy
    >>
    >>
    >> "David" <[email protected]> wrote in message
    >> news:[email protected]...
    >>> Greetings and TIA for your time
    >>> Button1 triggers Macro1. Macro1 has code to change the text on Button1
    >>> Using a button from the 'forms' toolbar
    >>> I've tried:ActiveSheet.Shapes("Button 1").Characters.Text = "NewText" -
    >>> which fails.
    >>> What code should I use?
    >>> David

    >>
    >>

    >
    >




+ 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