Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I wanted to know if anyone knew the code to create a list box, tha
retrieves all the .xls files stored in a folder. Clicking on th retrieved file would then open the work book Can anyone help -- Message posted from http://www.ExcelForum.com |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This is a good answer, but post back if you must have a listbox on the
sheet. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "mudraker " wrote in message ... Have a look at GetOpenFilename --- Message posted from http://www.ExcelForum.com/ |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Bob,
the files inside the directory do have to be displayed inside a lis box..... -- Message posted from http://www.ExcelForum.com |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Okay, give this a try
Sub CreateFormsListBox() Dim FSO As Object Dim Folder As Object Dim file As Object Dim Files As Object Dim sPath As String Dim oList As ListBox Application.CommandBars("Forms").Visible = True ActiveSheet.ListBoxes.Add(18, 12.75, 150, 200).Select Selection.OnAction = "myPrintMacro" Set oList = Selection Set FSO = CreateObject("Scripting.FileSystemObject") sPath = "C:\MyTest" Set Folder = FSO.GetFolder(sPath) Set Files = Folder.Files For Each file In Files oList.AddItem file.Name Next file Range("A1").Select End Sub -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "suee " wrote in message ... Hi Bob, the files inside the directory do have to be displayed inside a list box...... --- Message posted from http://www.ExcelForum.com/ |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thats great!!
The only change i need is when u click on the desired file from th list....it will open that filein excel.....rather than call amacro a it does now Any help here would be grea -- Message posted from http://www.ExcelForum.com |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
change directory to list default | Excel Discussion (Misc queries) | |||
Combo box with list of xls files in a directory | Excel Discussion (Misc queries) | |||
List of Files in A Directory | Excel Discussion (Misc queries) | |||
list directory in EXCEL | Excel Discussion (Misc queries) | |||
List of folders in a certain directory | Excel Discussion (Misc queries) |