Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
below code helps me to get all worksheetnames from different workbooks which are in different folders.I can see all as a list in a worksheet.But I want to see them as links, when I click any worksheet name, the workbook will be opened. regards. Sub GetAllWorksheetNames() Dim i As Integer Dim wbResults As Workbook Dim wbCodeBook As Workbook Dim wSheet As Worksheet Application.ScreenUpdating = False Application.DisplayAlerts = False Application.EnableEvents = False On Error Resume Next Set wbCodeBook = ThisWorkbook With Application.FileSearch .NewSearch .LookIn = "D:\Yeni Klasör" 'amend to suit .SearchSubFolders = True .Filename = "*.xls" If .Execute 0 Then For i = 1 To .FoundFiles.Count Set wbResults = Workbooks.Open(.FoundFiles(i)) wbCodeBook.Sheets(1).Range _ ("A65536").End(xlUp)(2, 7) = UCase(wbResults.Name) For Each wSheet In wbResults.Worksheets wbCodeBook.Sheets(1).Range _ ("A65536").End(xlUp)(2, 1) = wSheet.Name Next wSheet wbResults.Close SaveChanges:=False Next i End If End With On Error GoTo 0 Application.ScreenUpdating = True Application.DisplayAlerts = True Application.EnableEvents = True End Sub -- SAHRAYICEDIT-ISTANBUL |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Slow opening links between workbooks with links created in 2003 | Excel Discussion (Misc queries) | |||
Update links box gives Continue or Edit Links dialog | Excel Discussion (Misc queries) | |||
getting worksheetnames from subfolders | Excel Programming | |||
Edit Links: Changing links on a protected worksheet | Excel Discussion (Misc queries) | |||
EXCEL - LINKS cannot easily get list of all links & names in book | Excel Worksheet Functions |