Creating a Dynamic List

Ark68

Well-known Member
Joined
Mar 23, 2004
Messages
4,564
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I am having a difficult time find an efficient solution to a task I would like to complete. I've managed to do a bit, but it involves an exhaustive code of nested select case and if /elseif statements. I've found it very difficult to trouble shoot as a result.

I have a database of scheduled staff and their scheduled times.


Excel 2010
RSTUVW
24ShiftCrewNameStartStop
25CUE11Kelly0.2916670.62525
26CUE2XNot Staffed0.2916670.62526
27CUL12Jen0.666667127
28HPE1CTessa0.2916670.62528
29HPE2XNot Staffed0.2916670.62529
30HPL1AMorgan0.56250.89583330
31HPL2XNot Staffed0.56250.89583331
32RPE1CAshley B.0.2916670.62532
33RPE2XNot Staffed0.2916670.62533
34RPL1ACorey0.56250.89583334
35RPL2XNot Staffed0.2916670.62535
36WPE1CLauren0.2916670.62536
37WPE2XNot Staffed0.2916670.62537
38WPL1AKiana0.56250.89583338
39WPL2AJessica0.6458330.812539
40PTE1XNot Staffed0.2916670.62540
41PTE2XNot Staffed0.2916670.62541
4242
VAR_HOLD


A service range (range of time) has been defined:
lowrange = 1:30 PM, and highrange = 2:00 PM.

What I am trying to accomplish, is to generate a dynamic list of "shifts" (column R) of those employees scheduled (crew <> "X") capable of providing this service. The service start must fall between the employee's shift start and end times to be eligible.

The target range of the dynamic list (to be used as rowsource data for a combobox) is worksheet("var_hold").range("X2")

If anyone is able to assist me, I will be very grateful of the effort.
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
I did the below utilizing the Data Advanced Filter Option: Note there are Hidden Rows between Row 25 and 41 (which are those not qualifying per the Criteria assigned).
Hope this helps...


Excel 2010
QRSTUVWXYZAA
19
20LowRangeHighRange
211:30 PM2:30 PM
22
23CrewStartStop
24ShiftCrewNameStartStopRow#<>X
25CUE11Kelly0.291670.62525>=0.5625<=0.604166666666667
27CUL12Jen0.66667127
28HPE1CTessa0.291670.62528
30HPL1AMorgan0.56250.8958330
32RPE1CAshley B.0.291670.62532
34RPL1ACorey0.56250.8958334
36WPE1CLauren0.291670.62536
38WPL1AKiana0.56250.8958338
39WPL2AJessica0.645830.812539
42

<colgroup><col style="width: 25pxpx"><col><col><col><col><col><col><col><col><col><col><col></colgroup><thead>
</thead><tbody>
</tbody>
VAR_HOLD

Worksheet Formulas
CellFormula
Y24="<>" & "X"
Z25=">="& $Z$21
AA25="<="& $AA$21

<thead>
</thead><tbody>
</tbody>

<tbody>
</tbody>
 
Upvote 0
Thank you Jim for your suggestion! I had overlooked the power and flexibility of the advanced filter.
I'll see what I can do to adapt it to my VBA project. I'm sure it's exactly what I need.
 
Upvote 0

Forum statistics

Threads
1,215,020
Messages
6,122,712
Members
449,093
Latest member
Mnur

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top