+ Reply to Thread
Results 1 to 8 of 8

Name checkbox with vba

  1. #1
    Registered User
    Join Date
    01-29-2019
    Location
    Roermond
    MS-Off Ver
    365
    Posts
    25

    Name checkbox with vba

    Dear forum,

    In a userform are multiple checkboxes. The come in sets of two (yes or No)
    If a checkbox is clicked (true) then a cell value in sheet1 = "yes"

    Upon 'Initialize' I want the backcolor of one of two checkboxes to change.
    To do this I've assigned an ID to every couple of checkboxes
    For example:

    HTML Code: 
    The checkboxes in the userform are cb1 and cb2 etc.
    When running this code I get an error 91, object variable with, etc..

    Please help.
    Or is there a better way to do this? Sure there is, however....

    Regards, Rudy
    Last edited by ruud1957; 02-24-2019 at 09:13 AM.

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

    Re: Name checkbox with vba

    Rudy

    How/where/when are you setting a and b?

    Are a and be the name of the checkboxes?
    If posting code please use code tags, see here.

  3. #3
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Name checkbox with vba

    Firstly if you have Yes No options then you should use option buttons. If any option buttons are within the same frame then only one can be selected at any time.

    Attach a sample workbook (not a picture or pasted copy). Make sure there is just enough data to demonstrate your need. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are shown, mock them up manually if necessary.

    Remember to desensitize the data.

    Click on GO ADVANCED and then scroll down to Manage Attachments to open the upload window.
    My General Rules if you want my help. Not aimed at any person in particular:

    1. Please Make Requests not demands, none of us get paid here.

    2. Check back on your post regularly. I will not return to a post after 4 days.
    If it is not important to you then it definitely is not important to me.

  4. #4
    Registered User
    Join Date
    01-29-2019
    Location
    Roermond
    MS-Off Ver
    365
    Posts
    25

    Re: Name checkbox with vba

    Hi Norie and Mehmetcik ,

    Thank you for your reply.
    I've wrestled up and attached a version of the workbook.
    Hope it makes any sence.

    Regards, Rudy
    Attached Files Attached Files

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

    Re: Name checkbox with vba

    Can you explain, in words, what you are trying to do?

  6. #6
    Registered User
    Join Date
    01-29-2019
    Location
    Roermond
    MS-Off Ver
    365
    Posts
    25

    Re: Name checkbox with vba

    Hi Norie,

    Because there are about 80 checkboxes, I'm somewhat hesitant to write code for all of them seperately. So I've tryed coming up with a way to load the questionair-sheet, showing the result of an earlier checklist as to the buttons Ja, Nee and Nvt. (Yes, no, not applicable).

    The checklist can be obtained via listbox2 through listbox1. Listbox2 give a choice of checklists ordered by date, related to a street address in listbox1.
    From there on in, with that code slightly changed, I should also be able to make new checklists and fill them.

    I've noticed that, because of the sloppy way I've wrestled up the Test.xlsm, the data doesn't exactly show up like it does in the original file. Sorry for that.

    Regards, Rudy.

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

    Re: Name checkbox with vba

    Rudy

    Do you have a list of questions somewhere?

  8. #8
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Name checkbox with vba

    I have created a simplified Userform for you to study.

    Please Login or Register  to view this content.
    Attached Files Attached Files

+ 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] Make Worksheet Active-X CheckBox value same as Userform CheckBox value
    By L plates in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-21-2016, 08:23 AM
  2. Select All Checkboxes Checkbox That Also Calls Checkbox Macros
    By Intervigilium in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-23-2015, 06:41 PM
  3. Protect the sheet but the form checkbox still can be change and sort by checkbox
    By carolyn1221 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-19-2014, 01:08 PM
  4. Replies: 0
    Last Post: 04-07-2014, 12:22 PM
  5. Lock cell linked to checkbox when checkbox is ticked
    By simeony003 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-30-2013, 10:08 AM
  6. Replies: 4
    Last Post: 07-22-2013, 01:37 PM
  7. [SOLVED] How do I change a checkbox to unchecked without running the code within the checkbox
    By jsunnb in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-27-2012, 09:28 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