you have created your own Initialize routine but not called it.
A userform will always have this signature for it's Initialize event, regardless of what the actual form is called.
Private Sub UserForm_Initialize()
End Sub
so you need to either place you code in that event or call your code from that event.
Private Sub UserForm_Initialize()
FRM_TubingTracker_Initialize
End Sub
You also need to change the other routines to use the sheet refrence/range syntax.
Along with changing the column number used to get last row for a particular column
Private Sub InitializePropertyDataCBX()
Dim vntList As Variant
With Worksheets("COMBOBOX DATA")
vntList = .Range("C2", .Cells(.Rows.Count, 3).End(xlUp))
If IsArray(vntList) Then
FRM_TubingTracker.CBX_FromLocationName.List = vntList
Else
FRM_TubingTracker.CBX_FromLocationName.AddItem vntList
End If
FRM_TubingTracker.CBX_ToLocationName.List = FRM_TubingTracker.CBX_FromLocationName.List
vntList = .Range("D2", .Cells(.Rows.Count, 4).End(xlUp))
If IsArray(vntList) Then
FRM_TubingTracker.CBX_FromLocationNumber.List = vntList
Else
FRM_TubingTracker.CBX_FromLocationNumber.AddItem vntList
End If
FRM_TubingTracker.CBX_ToLocationNumber.List = FRM_TubingTracker.CBX_FromLocationNumber.List
vntList = .Range("E2", .Cells(.Rows.Count, 5).End(xlUp))
If IsArray(vntList) Then
FRM_TubingTracker.CBX_FromLocationAFE.List = vntList
Else
FRM_TubingTracker.CBX_FromLocationAFE.AddItem vntList
End If
FRM_TubingTracker.CBX_ToLocationAFE.List = FRM_TubingTracker.CBX_FromLocationAFE.List
End With
End Sub
'==============================================================================================
Private Sub InitializeTubingDataCBX()
Dim vntList As Variant
With Worksheets("COMBOBOX DATA")
vntList = .Range("I2", .Cells(.Rows.Count, 9).End(xlUp))
End With
FRM_TubingTracker.CBX_TubingDescription.List = vntList
End Sub
'==============================================================================================
Private Sub InitializeSupervisorDataCBX()
Dim vntList As Variant
With Worksheets("COMBOBOX DATA")
vntList = .Range("G2", .Cells(.Rows.Count, 7).End(xlUp))
End With
FRM_TubingTracker.CBX_Supervisor.List = vntList
End Sub
'==============================================================================================
Private Sub InitializeDateDataCBX()
Dim vntList As Variant
With Worksheets("COMBOBOX DATA")
vntList = .Range("A2", .Cells(.Rows.Count, 1).End(xlUp))
End With
FRM_TubingTracker.CBX_Date.List = vntList
End Sub
Bookmarks