Not* sure how to write code to filter through 5 worksheets..
I have 5 different listboxes on a userform. Each listbox shows days/times (two columns) options of different courses available. When the user selects one of the class options that he wants to take, all of the other options in that specific list box need to be disabled/hidden/deleted, and so does the classes in the other 4 list boxes that conflict with the time of the class chosen. Does this make sense?
I do not now how to write "filtering/deleting" code within If statements..
Each list box contains a range of date from a separate worksheet.. they are "ENGL 104", "PSYC 102", "CSCI 240", "ECON 260", and "MGMT 217"
If it helps to understand, the 5 list boxes are named "ENGL104", "PSYC102", "CSCI240H", "ECON260", and "MGMT217H". the lists inside look like this:
<table border="0" cellpadding="0" cellspacing="0" width="368"><colgroup><col style="mso-width-source:userset;mso-width-alt:6729; width:138pt" span="2" width="184"> </colgroup><tbody><tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;width:138pt" height="20" width="184">MoWe</td> <td class="xl64" style="border-left:none;width:138pt" width="184">2:00PM - 3:15PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWe</td> <td class="xl64" style="border-top:none;border-left:none">2:00PM - 3:15PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWe</td> <td class="xl64" style="border-top:none;border-left:none">2:00PM - 3:15PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWe</td> <td class="xl64" style="border-top:none;border-left:none">3:30PM - 4:45PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWe</td> <td class="xl64" style="border-top:none;border-left:none">3:30PM - 4:45PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWe</td> <td class="xl64" style="border-top:none;border-left:none">3:30PM - 4:45PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">1:00PM - 1:50PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">1:00PM - 1:50PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">1:00PM - 1:50PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">1:00PM - 1:50PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">1:00PM - 1:50PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">1:00PM - 1:50PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">1:00PM - 1:50PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">10:00AM - 10:50AM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">10:00AM - 10:50AM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">10:00AM - 10:50AM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">10:00AM - 10:50AM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">10:00AM - 10:50AM</td> </tr> </tbody></table>
Any suggestions would be great! Thank you!
I have 5 different listboxes on a userform. Each listbox shows days/times (two columns) options of different courses available. When the user selects one of the class options that he wants to take, all of the other options in that specific list box need to be disabled/hidden/deleted, and so does the classes in the other 4 list boxes that conflict with the time of the class chosen. Does this make sense?
I do not now how to write "filtering/deleting" code within If statements..
Each list box contains a range of date from a separate worksheet.. they are "ENGL 104", "PSYC 102", "CSCI 240", "ECON 260", and "MGMT 217"
If it helps to understand, the 5 list boxes are named "ENGL104", "PSYC102", "CSCI240H", "ECON260", and "MGMT217H". the lists inside look like this:
<table border="0" cellpadding="0" cellspacing="0" width="368"><colgroup><col style="mso-width-source:userset;mso-width-alt:6729; width:138pt" span="2" width="184"> </colgroup><tbody><tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;width:138pt" height="20" width="184">MoWe</td> <td class="xl64" style="border-left:none;width:138pt" width="184">2:00PM - 3:15PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWe</td> <td class="xl64" style="border-top:none;border-left:none">2:00PM - 3:15PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWe</td> <td class="xl64" style="border-top:none;border-left:none">2:00PM - 3:15PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWe</td> <td class="xl64" style="border-top:none;border-left:none">3:30PM - 4:45PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWe</td> <td class="xl64" style="border-top:none;border-left:none">3:30PM - 4:45PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWe</td> <td class="xl64" style="border-top:none;border-left:none">3:30PM - 4:45PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">1:00PM - 1:50PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">1:00PM - 1:50PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">1:00PM - 1:50PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">1:00PM - 1:50PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">1:00PM - 1:50PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">1:00PM - 1:50PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">1:00PM - 1:50PM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">10:00AM - 10:50AM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">10:00AM - 10:50AM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">10:00AM - 10:50AM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">10:00AM - 10:50AM</td> </tr> <tr style="height:15.0pt" height="20"> <td class="xl64" style="height:15.0pt;border-top:none" height="20">MoWeFr</td> <td class="xl64" style="border-top:none;border-left:none">10:00AM - 10:50AM</td> </tr> </tbody></table>
Any suggestions would be great! Thank you!
Last edited: