#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 347
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9,101
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 347
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Comparing List A to List B and add what's missing from List B Gilbert Excel Discussion (Misc queries) 2 July 20th 09 11:18 PM
Comparing List A to List B and add what's missing from List B Gilbert Excel Discussion (Misc queries) 1 July 20th 09 08:41 PM
validation list--list depends on the selection of first list Michael New Users to Excel 2 April 27th 06 10:23 PM
list 1 has 400 names List 2 has 4000. find manes from list 1 on 2 Ed Excel Worksheet Functions 5 September 12th 05 09:48 AM
find names on list 1 in list 2. list 1 4000 names list 2 400 name Ed Excel Worksheet Functions 1 September 4th 05 12:48 AM


All times are GMT +1. The time now is 01:14 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"