ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Populating Lists in forms (https://www.excelbanter.com/excel-programming/363508-populating-lists-forms.html)

marksince1984[_2_]

Populating Lists in forms
 

Hello all,

I have a list which I can get to appear in a list box.

What I want to do is then show a list of 6 items which are unique to
the item selected in the first box.

Every item in the first box has its own set of unique values

Any ideas??

Thanks

Mark


--
marksince1984
------------------------------------------------------------------------
marksince1984's Profile: http://www.excelforum.com/member.php...o&userid=33484
View this thread: http://www.excelforum.com/showthread...hreadid=549238


Tom Ogilvy

Populating Lists in forms
 
With no other details, maybe this will inspire you.

Private Sub Listbox1_Click()
Dim cell as Range
Dim secondList as Range
set secondList = Worksheets("Sheet2").Range("A1").CurrentRegion
' remove headers
set secondList = secondList.offset(1,0).Resize(Secondlist.Rows.coun t-1,1)
Listbox2.Clear
for each cell in secondlist
if cell.Value = Listbox1.Value then
Listbox2.AddItem cell.Offset(0,1)
end if
Next
End sub

--
Regards,
Tom Ogilvy


"marksince1984"
wrote in message
news:marksince1984.2909za_1149639601.5537@excelfor um-nospam.com...

Hello all,

I have a list which I can get to appear in a list box.

What I want to do is then show a list of 6 items which are unique to
the item selected in the first box.

Every item in the first box has its own set of unique values

Any ideas??

Thanks

Mark


--
marksince1984
------------------------------------------------------------------------
marksince1984's Profile:

http://www.excelforum.com/member.php...o&userid=33484
View this thread: http://www.excelforum.com/showthread...hreadid=549238





All times are GMT +1. The time now is 02:59 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com