Hi there
I'm using a formula function to create a value called vList, which is a list of names.
After the list has been created, I then want to assign the same list to a number of comboboxes. Is there any way of shortening the code that follows:
I tried using a For/Next loop for 1 to 40, but it didn't work.
Is it possible?
I'm using a formula function to create a value called vList, which is a list of names.
After the list has been created, I then want to assign the same list to a number of comboboxes. Is there any way of shortening the code that follows:
Code:
If UBound(NameList, 1) > 0 Then
Me.DealerShiftTime1.List = vList
Me.DealerShiftTime2.List = vList
Me.DealerShiftTime3.List = vList
Me.DealerShiftTime4.List = vList
Me.DealerShiftTime5.List = vList
Me.DealerShiftTime6.List = vList
Me.DealerShiftTime7.List = vList
Me.DealerShiftTime8.List = vList
Me.DealerShiftTime9.List = vList
Me.DealerShiftTime10.List = vList
Me.DealerShiftTime11.List = vList
Me.DealerShiftTime12.List = vList
Me.DealerShiftTime13.List = vList
Me.DealerShiftTime14.List = vList
Me.DealerShiftTime15.List = vList
Me.DealerShiftTime16.List = vList
Me.DealerShiftTime17.List = vList
Me.DealerShiftTime18.List = vList
Me.DealerShiftTime19.List = vList
Me.DealerShiftTime20.List = vList
Me.DealerShiftTime21.List = vList
Me.DealerShiftTime22.List = vList
Me.DealerShiftTime23.List = vList
Me.DealerShiftTime24.List = vList
Me.DealerShiftTime25.List = vList
Me.DealerShiftTime26.List = vList
Me.DealerShiftTime27.List = vList
Me.DealerShiftTime28.List = vList
Me.DealerShiftTime29.List = vList
Me.DealerShiftTime30.List = vList
Me.DealerShiftTime31.List = vList
Me.DealerShiftTime32.List = vList
Me.DealerShiftTime33.List = vList
Me.DealerShiftTime34.List = vList
Me.DealerShiftTime35.List = vList
Me.DealerShiftTime36.List = vList
Me.DealerShiftTime37.List = vList
Me.DealerShiftTime38.List = vList
Me.DealerShiftTime39.List = vList
Me.DealerShiftTime40.List = vList
End If
I tried using a For/Next loop for 1 to 40, but it didn't work.
Is it possible?