+ Reply to Thread
Results 1 to 5 of 5

Change Checkbox Caption on Userform with Name in Variable

  1. #1
    Registered User
    Join Date
    09-11-2009
    Location
    MN
    MS-Off Ver
    Office 2010
    Posts
    48

    Change Checkbox Caption on Userform with Name in Variable

    I have a workbook where users select a specific type of notification email they want to create and send out. There are 8 different types of notifications that open different userforms (which all ask different questions, etc...). The one thing they have is common is a group of checkboxes with the same name that open another userform where the user can select the email groups they want the notification sent to.

    After they've selected the groups they want to email and hit OK to close out of the email userform, I want to update the checkbox caption on the notification userform to display how many groups were selected. I really don't want to update the caption on all 8 userforms and instead would just like to update the caption on the userform that initiated the action.

    I thought I could do this by storing the userform name in a variable (frmName) and then reference the variable and the checkbox... something like frmName.chk2.caption = "something". My variable is currently Public and stored in a module. I've tried different types like object, userform, string, etc... but I just bounce between various errors and can't seem to figure this out.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Change Checkbox Caption on Userform with Name in Variable

    Which of the 8 userforms do you want to change the caption of?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    09-11-2009
    Location
    MN
    MS-Off Ver
    Office 2010
    Posts
    48

    Re: Change Checkbox Caption on Userform with Name in Variable

    Whichever one they were on. It will be different every time. That's why I was trying to use a variable for the userform name.
    Last edited by XLVBA; 12-11-2013 at 01:47 PM.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,646

    Re: Change Checkbox Caption on Userform with Name in Variable

    Where are you going to change the caption from?

  5. #5
    Registered User
    Join Date
    09-11-2009
    Location
    MN
    MS-Off Ver
    Office 2010
    Posts
    48

    Re: Change Checkbox Caption on Userform with Name in Variable

    I have been trying to change it from the userform that displays the email groups they can select, in the code for the command button they will click to OK once they've chosen the groups. If I can figure out how to change the checkbox caption by using the userform name in a variable then it seems like I wouldn't have to duplicate so much code. If I try to do it from the notification userforms then I would have to do the code on each different form, unless I'm missing something.

    I'm open to suggestions, but it seems like if there is a way to do this it would be the most efficient.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Change label caption's font color based on value in another textbox
    By MileHigh_PhD in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-19-2013, 01:59 PM
  2. UserForm Caption Change
    By mrdoctor in forum Excel General
    Replies: 3
    Last Post: 01-13-2012, 03:36 AM
  3. Userform help - Caption will not change
    By PY_ in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-22-2011, 09:26 PM
  4. Possible to change Form caption to cell value or variable
    By JP Romano in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-24-2009, 04:36 PM
  5. Replies: 1
    Last Post: 08-11-2006, 04:25 PM

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