Results 1 to 3 of 3
  1. #1
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Change caption at run time (Win XP, Office2003, Excel)

    Hi,

    I've got a cmdBtn, Caption is "Add Item"

    At runtime I test whether "an item" already exists.
    If no item exists, the caption shall remain "Add item", but if an item already exists, the caption should change to "Replace item".

    I've tried to loop through the shapes collection, but end up short of a .caption property.

    How do I change the .caption value during run-time?
    Bests,
    RD


    PS: Wish there were a knob on the TV to turn up the intelligence. There's a knob called "brightness," but that doesn't work

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Change caption at run time (Win XP, Office2003, Excel)

    If it's a command button from the controls toolbox on a worksheet , you can use:
    <code>activesheet.shapes("CommandButton1").oleform at.object.object.caption</code>

    HTH
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Denmark
    Posts
    347
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Change caption at run time (Win XP, Office2003, Excel)

    Hi Rory,

    Apologies on late reply.
    Worked like a charm, thanks.
    Bests,
    RD


    PS: Wish there were a knob on the TV to turn up the intelligence. There's a knob called "brightness," but that doesn't work

Posting Permissions

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