G
GregJG
I have a user form with combo boxes that draw the list from anothe
workbook. I use this code.
Private Sub UserForm_Initialize()
Dim wb As Workbook
Set wb = Workbooks.Open("f:\db1.xls")
For Each cell In wb.Sheets("Cust").Range("a2:A500")
Me.cboCust.AddItem cell.Value
Next cell
For Each cell In wb.Sheets("Subdiv").Range("a2:A500")
Me.cboSub.AddItem cell.Value
Next cell
wb.Close False
My problem is the .Range, instead of going to row 500, is ther
something I could do to make the list end at the last row used
regardless how long the list will becomes
workbook. I use this code.
Private Sub UserForm_Initialize()
Dim wb As Workbook
Set wb = Workbooks.Open("f:\db1.xls")
For Each cell In wb.Sheets("Cust").Range("a2:A500")
Me.cboCust.AddItem cell.Value
Next cell
For Each cell In wb.Sheets("Subdiv").Range("a2:A500")
Me.cboSub.AddItem cell.Value
Next cell
wb.Close False
My problem is the .Range, instead of going to row 500, is ther
something I could do to make the list end at the last row used
regardless how long the list will becomes