+ Reply to Thread
Results 1 to 3 of 3

CommandButton caption set on open

  1. #1
    Forum Contributor
    Join Date
    11-17-2004
    MS-Off Ver
    Office 2016
    Posts
    527

    CommandButton caption set on open

    How do I set the CommandButton.Caption value specifically when the worksheet is opened. I use commands to change the caption every time the button is pressed but I want to make sure that every time the worksheet is opened the caption for the buttons always start out with a specific caption. If the worksheet is saved with the wrong button caption, my functions don't work correctly.

  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

    Re: CommandButton caption set on open

    Hello JimDandy,

    Place your code to change the Command Button captions in the Workbook_Open() event module. If you are calling macros from another module to do this rather than having the code resident in the Open module, you will need to prefix the macro call with the name of the module it is in or it won't work. For example, let's say you have a macro named Caption1Macro in Module1. In the Open event module it would be written as Module1.Caption1Macro
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Contributor
    Join Date
    11-17-2004
    MS-Off Ver
    Office 2016
    Posts
    527

    Re: CommandButton caption set on open

    Great! Thank you...much appreciated

+ 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