Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Can anyone share idea(s) for code that will programatically loop
through all the .xls files in a directory (path is c:\Data\DataFiles) and 1) set the Visible property for all ten worksheets in each .xls file to visible? Here's what I've tried so far... Option Explicit Sub VisibleTrue() Dim basebook As Workbook Dim mybook As Workbook 'Dim Item As Worksheet Dim i As Long Application.ScreenUpdating = False With Application.FileSearch .NewSearch .LookIn = "C:\Data\DataFiles\Sept" .SearchSubFolders = False .FileType = msoFileTypeExcelWorkbooks If .Execute() 0 Then Set basebook = ThisWorkbook For i = 1 To .FoundFiles.Count Set mybook = Workbooks.Open(.FoundFiles(i)) For Each sh In Sheets sh.Visible = True Next sh Next i End If mybook.Close Application.ScreenUpdating = True End Sub Any ideas are greatly appreciated. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Multiple Excel files visible | Setting up and Configuration of Excel | |||
Windows Visible Property - Code Help | Excel Discussion (Misc queries) | |||
Upload multiple text files into 1 excel worksheet + put the filename as the first column in the worksheet | Excel Worksheet Functions | |||
Multiple Text files into one worksheet-need help | Excel Discussion (Misc queries) | |||
.Visible Property | Excel Programming |