Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can someone help me to get name of all the files in the
folder in excel with the hyperlinks to the same within excel? It should be able to choose the folder by user so that my all the users can use it. I have tried using macro recorder but failed. This reqd for the companys huge data base sorted and kept in different folders on the intranet. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It might be better to have the list and then just use a double click event
to goto the file. This should list the files Sub GetFileList() Dim iCtr As Integer With Application.FileSearch .NewSearch .LookIn = "c:\yourfolder" ' .SearchSubFolders = True .Filename = ".xls" If .Execute 0 Then For iCtr = 1 To .FoundFiles.Count Cells(iCtr, 1).Value = .FoundFiles(iCtr) Next iCtr End If End With End Sub Then this should goto the file by a double click on the typed name. ======== Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean) Application.DisplayAlerts = False Dim WantedSheet As String WantedSheet = Trim(ActiveCell.Value) If WantedSheet = "" Then Exit Sub On Error Resume Next If Sheets(ActiveCell.Value) Is Nothing Then GetWorkbook ' calls another macro to do that Else Sheets(ActiveCell.Value).Select ActiveSheet.Range("a4").Select End If Application.DisplayAlerts = True End Sub Sub GetWorkbook() If ActiveCell.Value = "" Then Exit Sub workbookname = ActiveCell.Value On Error GoTo OpenWorkbook Windows("" & workbookname & ".xls").Activate Exit Sub OpenWorkbook: Workbooks.Open(workbookname & ".xls").RunAutoMacros xlAutoOpen Exit Sub End Sub ========= "yang" wrote in message ... Can someone help me to get name of all the files in the folder in excel with the hyperlinks to the same within excel? It should be able to choose the folder by user so that my all the users can use it. I have tried using macro recorder but failed. This reqd for the companys huge data base sorted and kept in different folders on the intranet. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Read Files from a folder into an Excel drop down list or Combo Box | Excel Discussion (Misc queries) | |||
Creating a List of the files in a folder in excel | Excel Discussion (Misc queries) | |||
how do i print a list of files in a folder in excel? | New Users to Excel | |||
create a list of worksheet names (from a single folder, or open files) | Excel Discussion (Misc queries) | |||
Getting list of files in a folder to excel | Excel Programming |