Consulting

Results 1 to 3 of 3

Thread: Code VBA checkbox and optionbox

  1. #1
    VBAX Regular
    Joined
    Jan 2014
    Posts
    12
    Location

    Code VBA checkbox and optionbox

    HI everyone,

    I want to using VBA for run checkbox.

    if checkbox 1 = true, listbox1 only appearance value column A and B with column C.value=1 (sheet "Basic")
    checkbox 2 = true, listbox1 only appearance value column A and B with column C.value=2 (sheet "Basic")

    if optionbox 1 = true, listbox1 only appearance value column A and B with column D.value=1 (sheet "Basic")
    optionbox 2 = true, listbox1 only appearance value column A and B with column D.value=2 (sheet "Basic")
    optionbox 3 = true, listbox1 only appearance value column A and B with column D.value=3 (sheet "Basic")

    Thank you very much
    Attached Files Attached Files

  2. #2
    VBAX Guru Kenneth Hobs's Avatar
    Joined
    Nov 2005
    Location
    Tecumseh, OK
    Posts
    4,956
    Location
    I would suggest making your logic a bit more clear. Obviously, checkbox 1 and 2 can both be checked so that needs optionboxes too instead I suspect. IF one of the checkboxes are checked, then I would guess that you may then want to include all rows in columns A and B that match both the first set of options boxes and the 2nd set of option boxes criterion.

    Another Idea to consider is to let the user select the options from the data in comboboxes. I would do a combobox for the column C and one for the Column D. Those are really easy to do. This would handle the case where later you add another option say 5 for the column D data. That combobox would list 1,2,3,5.

  3. #3
    VBAX Regular
    Joined
    Jan 2014
    Posts
    12
    Location
    Quote Originally Posted by Kenneth Hobs View Post
    I would suggest making your logic a bit more clear. Obviously, checkbox 1 and 2 can both be checked so that needs optionboxes too instead I suspect. IF one of the checkboxes are checked, then I would guess that you may then want to include all rows in columns A and B that match both the first set of options boxes and the 2nd set of option boxes criterion. Another Idea to consider is to let the user select the options from the data in comboboxes. I would do a combobox for the column C and one for the Column D. Those are really easy to do. This would handle the case where later you add another option say 5 for the column D data. That combobox would list 1,2,3,5.
    Hi Mr Kenneth Hobs, I want to listbox 1 will appearance data column A and B from sheet "Basic" if checkbox 1 and 2 can both be checked it is mean all kind of concentration drug will appearance data column A and B from sheet "Basic" in listbox1 if checkbox 1 = true, only concentration of adult will appearance data column A and B from sheet "Basic" in listbox1 if checkbox 2 = true, only concentration of children will appearance data column A and B from sheet "Basic" in listbox1

Posting Permissions

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