Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
List Box
I created a list box so I can click on the item in the drop down and have it
open documents on our LAN and or C-Drive. How do I setup the items in my list box to open these items ? As of now in my workbook I have one sheet just for the list box and one sheet to list all the documents. Thanks |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
List Box
This code is intended to run with Listbox1. The best way of getting this
code to work is to do the following 1) Enter Design Mode by opening the toolbar Control Toolbox from menu View - Toolbars - control toolbox 2) Click on Triangle to enter/exit design mode. this is a toogle button. 3) When in Design mode double click listbox which will create the boiler plate for the listbox. Insert the second a third lines of the code below. chang ethe list box name in line 2 to match the name of the listbox in line 1. 4) Go back to worksheet and right click listbox. Select properties and change listfillrange to the following Sheet2!A1:A20 or the sheet and range where the filenames are located 5) Click on triangle in toolbar again to exit design mode. Clicking an item in the listbox should now open the file. Private Sub ListBox1_Click() FName = ActiveSheet.ListBox1.Value 'change listbox name to match header. Workbooks.Open Filename:=FName End Sub "George" wrote: I created a list box so I can click on the item in the drop down and have it open documents on our LAN and or C-Drive. How do I setup the items in my list box to open these items ? As of now in my workbook I have one sheet just for the list box and one sheet to list all the documents. Thanks |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
List Box
Joel - I am using Office 2007 but I don't think that makes a different,
anyway I tried what you gave me and nothing happens. The List Box in Sheet 1 shows the items I have loaded in sheet 2 and changes when I change the items in Sheet 2 so that part is working. But when I click on any on the items in the List Box on Sheet 1 it does no open any of the items. I loaded the code you gave me by right clicking on the sheet tab and scrolled up to View Code - is that right ? Thanks "Joel" wrote: This code is intended to run with Listbox1. The best way of getting this code to work is to do the following 1) Enter Design Mode by opening the toolbar Control Toolbox from menu View - Toolbars - control toolbox 2) Click on Triangle to enter/exit design mode. this is a toogle button. 3) When in Design mode double click listbox which will create the boiler plate for the listbox. Insert the second a third lines of the code below. chang ethe list box name in line 2 to match the name of the listbox in line 1. 4) Go back to worksheet and right click listbox. Select properties and change listfillrange to the following Sheet2!A1:A20 or the sheet and range where the filenames are located 5) Click on triangle in toolbar again to exit design mode. Clicking an item in the listbox should now open the file. Private Sub ListBox1_Click() FName = ActiveSheet.ListBox1.Value 'change listbox name to match header. Workbooks.Open Filename:=FName End Sub "George" wrote: I created a list box so I can click on the item in the drop down and have it open documents on our LAN and or C-Drive. How do I setup the items in my list box to open these items ? As of now in my workbook I have one sheet just for the list box and one sheet to list all the documents. Thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Comparing List A to List B and add what's missing from List B | Excel Discussion (Misc queries) | |||
Comparing List A to List B and add what's missing from List B | Excel Discussion (Misc queries) | |||
validation list--list depends on the selection of first list | New Users to Excel | |||
list 1 has 400 names List 2 has 4000. find manes from list 1 on 2 | Excel Worksheet Functions | |||
find names on list 1 in list 2. list 1 4000 names list 2 400 name | Excel Worksheet Functions |