Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() I have generated a ComboBox1 in a UserForm1. I have a list of data in Sheets("DoNotUse").Range("L3", "L57"). How do I get that list into my ComboBox. If it helps, this list is called 'grade' using 'Insert', 'Name', 'Define'. Is a ComboBox the best thing to use or should I be using a ListBox? -- grahammal ------------------------------------------------------------------------ grahammal's Profile: http://www.excelforum.com/member.php...o&userid=20336 View this thread: http://www.excelforum.com/showthread...hreadid=524268 |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
One way is to use:
Option Explicit Private Sub UserForm_Initialize() With Me.ComboBox1 .List = ThisWorkbook.Worksheets("donotuse").Range("define" ).Value End With End Sub If the cells contained values that were nicely formatted, you could add those nicely formatted values to the combobox: Option Explicit Private Sub UserForm_Initialize() Dim myCell As Range Dim myRng As Range Set myRng = ThisWorkbook.Worksheets("donotuse").Range("define" ) With Me.ComboBox1 For Each myCell In myRng.Cells .AddItem myCell.Text Next myCell End With End Sub grahammal wrote: I have generated a ComboBox1 in a UserForm1. I have a list of data in Sheets("DoNotUse").Range("L3", "L57"). How do I get that list into my ComboBox. If it helps, this list is called 'grade' using 'Insert', 'Name', 'Define'. Is a ComboBox the best thing to use or should I be using a ListBox? -- grahammal ------------------------------------------------------------------------ grahammal's Profile: http://www.excelforum.com/member.php...o&userid=20336 View this thread: http://www.excelforum.com/showthread...hreadid=524268 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|