RawlinsCross
Active Member
- Joined
- Sep 9, 2016
- Messages
- 437
So I have a userform that initializes with the following code. The comboboxes are named CB_AQUEOUS and CB_SOLDIS. I have ranges in Sheet1 that I source the lists from. But if the ranges change, I have to manually update the code. Is there a way I can simply do a *last row* on this? Is the fact that this is in an initialization routine problematic?
Code:
Private Sub UserForm_Initialize()
Me.DTPicker1 = Date - 190
Me.DTPicker2 = Date
'This is the code I want to look at.
CB_AQUEOUS.List = Worksheets("Sheet1").Range("A2:A36").Value
CB_SOLIDS.List = Worksheets("Sheet1").Range("B2:B11").Value
CB_AQUEOUS.Value = "---Please Select---"
CB_SOLIDS.Value = "---Please Select---"
Set mwksWorksheet = wWorksheetPVar
msICP = sSamplePVar
msICP = sICPPVar & sSamplePVar
Call PopulateControlArrays
Call MonthButtonColor
Call SetSummary
End Sub