Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I have tried numerous examples on how to populate a listbox from a range and can't get any of them to work. My only guess is that perhaps it is something different in excel 2003? Maybe I need to change something in properties? I'm using the default ListBox1 on a standard userform(Sub UserForm1_Initialize) and am trying to get a list from sheets(customers).range("a1:a30") Any ideas? -- Ramthebuffs ------------------------------------------------------------------------ Ramthebuffs's Profile: http://www.excelforum.com/member.php...o&userid=16429 View this thread: http://www.excelforum.com/showthread...hreadid=384141 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I am assuming the list1 is the name of listbox Private Sub UserForm_Initialize() For Each c In Range("a1:a30") if c.value<"" then list1.AddItem (c.Value) end if Next End Sub -- anilsolipuram ------------------------------------------------------------------------ anilsolipuram's Profile: http://www.excelforum.com/member.php...o&userid=16271 View this thread: http://www.excelforum.com/showthread...hreadid=384141 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() I just found this one line of code to do the work. I'm not sure what was wrong with every other method I tried. I kept on getting subscript out of range error. UserForm1.ListBox1.RowSource = "Customers!A1:a30" Thanks for the help though. -- Ramthebuffs ------------------------------------------------------------------------ Ramthebuffs's Profile: http://www.excelforum.com/member.php...o&userid=16429 View this thread: http://www.excelforum.com/showthread...hreadid=384141 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ramthebuffs,
Don't be coy, give us the details <g. It's hard to say without knowing what you've tried or what used to work for you. This works for me: Private Sub UserForm_Initialize() Me.ListBox1.List = Worksheets("customers").Range("A1:A30").Value End Sub hth, Doug "Ramthebuffs" wrote in message ... I have tried numerous examples on how to populate a listbox from a range and can't get any of them to work. My only guess is that perhaps it is something different in excel 2003? Maybe I need to change something in properties? I'm using the default ListBox1 on a standard userform(Sub UserForm1_Initialize) and am trying to get a list from sheets(customers).range("a1:a30") Any ideas? -- Ramthebuffs ------------------------------------------------------------------------ Ramthebuffs's Profile: http://www.excelforum.com/member.php...o&userid=16429 View this thread: http://www.excelforum.com/showthread...hreadid=384141 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
But how about multiple-columns? does it still works ?
"Doug Glancy" ... Ramthebuffs, Don't be coy, give us the details <g. It's hard to say without knowing what you've tried or what used to work for you. This works for me: Private Sub UserForm_Initialize() Me.ListBox1.List = Worksheets("customers").Range("A1:A30").Value End Sub hth, Doug "Ramthebuffs" wrote in message ... I have tried numerous examples on how to populate a listbox from a range and can't get any of them to work. My only guess is that perhaps it is something different in excel 2003? Maybe I need to change something in properties? I'm using the default ListBox1 on a standard userform(Sub UserForm1_Initialize) and am trying to get a list from sheets(customers).range("a1:a30") Any ideas? -- Ramthebuffs ------------------------------------------------------------------------ Ramthebuffs's Profile: http://www.excelforum.com/member.php...o&userid=16429 View this thread: http://www.excelforum.com/showthread...hreadid=384141 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Doug, that one seemed to work also. I think I'll use it actually, it looks a little more purdy ;-) I still don't really know what went wrong. Maybe it was just late and there was some simple answer to the problems I was having. Anyway, I much prefer 1 line to more. -- Ramthebuffs ------------------------------------------------------------------------ Ramthebuffs's Profile: http://www.excelforum.com/member.php...o&userid=16429 View this thread: http://www.excelforum.com/showthread...hreadid=384141 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Populating listbox | Excel Discussion (Misc queries) | |||
Populating listbox | Excel Programming | |||
Populating a ListBox | Excel Programming | |||
Populating combobox/listbox | Excel Programming | |||
Populating TextBox Value--using ListBox | Excel Programming |