gr8trthanu
Board Regular
- Joined
- Nov 14, 2008
- Messages
- 103
Hello,
I am trying to auto populate a combobox called "cmbID" from a range of cells but all I get is the running circle/times out.
The combo box is on a multipage object entitled "mtp1" which is located on a userform entitled "frmSchedule".
The information I am trying to autopopulate is from a list range entitled "PatientID" from an excel tab entitled "Patient Information"
When the userform loads I would like the combobox to autopopulate with the data from the list entitled "PatientID" which is in column A of the tab "Patient Information"
Unfortunately, I get the spinning time circle when the form is opened as VBA is trying to process the code. (I guess)
Is the range perhaps too big.
Here is the code I am using:
CODE:
***************************************************************************
Private Sub UserForm_Initialize()
'Populate combo box.
Dim rng As Range
Dim ws As Worksheet
Set ws = Worksheets("Patient Information")
For Each rng In ws.Range("PatientID")
Me.cmbID.AddItem rng
Next rng
End Sub
I am trying to auto populate a combobox called "cmbID" from a range of cells but all I get is the running circle/times out.
The combo box is on a multipage object entitled "mtp1" which is located on a userform entitled "frmSchedule".
The information I am trying to autopopulate is from a list range entitled "PatientID" from an excel tab entitled "Patient Information"
When the userform loads I would like the combobox to autopopulate with the data from the list entitled "PatientID" which is in column A of the tab "Patient Information"
Unfortunately, I get the spinning time circle when the form is opened as VBA is trying to process the code. (I guess)
Is the range perhaps too big.
Here is the code I am using:
CODE:
***************************************************************************
Private Sub UserForm_Initialize()
'Populate combo box.
Dim rng As Range
Dim ws As Worksheet
Set ws = Worksheets("Patient Information")
For Each rng In ws.Range("PatientID")
Me.cmbID.AddItem rng
Next rng
End Sub