G
Guest
Hello, I'm out of ideas, so I decided to post here... can someone please
tell me why this isn't working... I'm *trying* to populate a combo-box with
a list of "Agency Names" from a spreadsheet... here's my code. Thanks in
advance for all of your help!!
-Allen
Private Sub UserForm_Initialize()
Dim a As Integer
Dim cell As Range
Dim Rng As Range
a = 4
' I am trying to find where the "Agency Name" list begins.
Do While Worksheets(mEvent).Cells(a, 1).Value <> "Agency Name"
a = a + 1
Loop
' Once I find the list, I add one to the row value "a" so that "Agency Name
is not included in the list.
a = a + 1
' This is the code that populates the combo-box.
With Workbooks("Doctor & Agency Marketing DB.xls").Worksheets(mEvent)
' HERE IS WHERE I KEEP GETTING THE ERROR.
Set Rng = .Range(Cells(a, 1), .Range(Cells(a, 1)).End(xlDown))
End With
For Each cell In Rng.Cells
Me.cbAgency.AddItem cell.Value
Next cell
btnOK.Enabled = False
End Sub
tell me why this isn't working... I'm *trying* to populate a combo-box with
a list of "Agency Names" from a spreadsheet... here's my code. Thanks in
advance for all of your help!!
-Allen
Private Sub UserForm_Initialize()
Dim a As Integer
Dim cell As Range
Dim Rng As Range
a = 4
' I am trying to find where the "Agency Name" list begins.
Do While Worksheets(mEvent).Cells(a, 1).Value <> "Agency Name"
a = a + 1
Loop
' Once I find the list, I add one to the row value "a" so that "Agency Name
is not included in the list.
a = a + 1
' This is the code that populates the combo-box.
With Workbooks("Doctor & Agency Marketing DB.xls").Worksheets(mEvent)
' HERE IS WHERE I KEEP GETTING THE ERROR.
Set Rng = .Range(Cells(a, 1), .Range(Cells(a, 1)).End(xlDown))
End With
For Each cell In Rng.Cells
Me.cbAgency.AddItem cell.Value
Next cell
btnOK.Enabled = False
End Sub