+ Reply to Thread
Results 1 to 4 of 4

Set Userform Checkbox value to True if CheckBox.Caption string is found in another String

  1. #1
    Forum Contributor
    Join Date
    03-30-2016
    Location
    Gillette, WY
    MS-Off Ver
    Office 365
    Posts
    230

    Set Userform Checkbox value to True if CheckBox.Caption string is found in another String

    Hi all, TFiske...again,

    First of all, I want to thank to AlphaFrog, mehmetcik, Arkadi, bakerman2, xladept, and Winon for their help in getting me this far with this project.

    Here's the new problem:

    I have a Multi-Tab UserForm in which the user will check boxes if a given chemical is of a given type. Then the .Caption parameter for each box checked is concatenated with the following code and stored in a cell in column 4 of the "Chemical's" table:

    Please Login or Register  to view this content.
    Now, on the Edit Chemical Record tab of the userform, I need to set these checkboxes to True if their caption is found in the string generated by the code above when the user selects a stored Chemical Record from a ComboBox. I've tried a few approaches but haven't gotten anywhere.
    Most recently I've tried a public function with InStr:

    Please Login or Register  to view this content.
    This latest method gives me an "Expected End Sub" error. The other method's I've tried don't seem to do anything. I've attached a copy of the project. The UserForm in question is UsrFrm_ChemicalMaintenance. Thanks again!
    Attached Files Attached Files

  2. #2
    Forum Contributor
    Join Date
    03-30-2016
    Location
    Gillette, WY
    MS-Off Ver
    Office 365
    Posts
    230

    Re: Set Userform Checkbox value to True if CheckBox.Caption string is found in another Str

    It looks like I was getting the "Expected End Sub" error because "End Sub" was missing. I tried the following code and it seems to work:

    Please Login or Register  to view this content.
    I'll mark this as solved.

  3. #3
    Forum Expert Arkadi's Avatar
    Join Date
    02-13-2014
    Location
    Smiths Falls, Ontario, Canada
    MS-Off Ver
    Office 365
    Posts
    5,059

    Re: Set Userform Checkbox value to True if CheckBox.Caption string is found in another Str

    Well done
    Came to check and see you have taken care of your own problem
    Please help by:

    Marking threads as closed once your issue is resolved. How? The Thread Tools at the top
    Any reputation (*) points appreciated. Not just by me, but by all those helping, so if you found someone's input useful, please take a second to click the * at the bottom left to let them know

    There are 10 kinds of people in this world... those who understand binary, and those who don't.

  4. #4
    Forum Contributor
    Join Date
    03-30-2016
    Location
    Gillette, WY
    MS-Off Ver
    Office 365
    Posts
    230

    Re: Set Userform Checkbox value to True if CheckBox.Caption string is found in another Str

    Lol, thanks. I appreciate it!

+ 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. Userform Checkbox Caption Font Size
    By didless in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-05-2017, 06:09 PM
  2. [SOLVED] Userform checkbox caption to hide work sheet
    By L plates in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-03-2017, 08:08 AM
  3. [SOLVED] Userform Checkbox caption
    By TimlmiT in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 10-03-2014, 10:28 AM
  4. [SOLVED] Change Checkbox Caption After Userform Activation
    By pjcbm9 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-29-2014, 08:15 PM
  5. [SOLVED] Userform to rename caption of Multipage as per Checkbox
    By calvinle in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-07-2014, 11:07 AM
  6. Change Checkbox Caption on Userform with Name in Variable
    By XLVBA in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-11-2013, 04:43 PM
  7. Get UserForm checkbox caption and pass to another UserForm on click or mouse down
    By tulsaguy71 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-08-2013, 11:07 AM

Tags for this Thread

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