Hello All,
I have a user form with list box that is populated from a sheet in my workbook. However, when I click my button to run "Show_StatusForm" once and open the form, the list box will not populate. However, if I close the form and then reopen it with the same button, the list box will be populated. I don't understand why it will not populate the list box the first time I open the form.
This first section here is where I open the form and call my "listBoxReference" which populates the list box.
This section here is my called sub to populate the list box.
I have a user form with list box that is populated from a sheet in my workbook. However, when I click my button to run "Show_StatusForm" once and open the form, the list box will not populate. However, if I close the form and then reopen it with the same button, the list box will be populated. I don't understand why it will not populate the list box the first time I open the form.
This first section here is where I open the form and call my "listBoxReference" which populates the list box.
VBA Code:
Sub Show_StatusForm()
frmCCRStatus.Show
Call ListBoxReference
End Sub
This section here is my called sub to populate the list box.
VBA Code:
Sub ListBoxReference()
Dim iRow_Open As Long
'Find the last blank row
iRow_Open = ThisWorkbook.Worksheets("Open_CCR").Range("A" & Rows.Count).End(xlUp).Row
'Set Open list box reference
frmCCRStatus.lstOpenCCR.ColumnCount = 16
frmCCRStatus.lstOpenCCR.ColumnHeads = True
frmCCRStatus.lstOpenCCR.RowSource = "Open_CCR!A2:O" & iRow_Open
'If iRow_Open = 1 Then
' frmCCRStatus.lstOpenCCR.RowSource = "Open_CCR!A2:O2"
'Else
' frmCCRStatus.lstOpenCCR.RowSource = "Open_CCR!A2:O" & iRow_Open
'End If
End Sub