• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Looping through all workbooks in folder

Hey all, I am a total novice to VBA but have a repetitive task for several hundreds of workbooks that I've unsuccessfully searched for a solution. It involves removing the panes and frozen columns, renaming the tab to the contents of cell B5, and returning to cell A1. I have found that the code below will accomplish the tasks but I have been unsuccessful in my attempts to get them to loop through the folder. Any help would be great. Thanks.

Code:
Sub RESETING()
'
' RESETING Macro
'

'
    ActiveWindow.DisplayGridlines = False
    Range("C1").Select
    ActiveCell.FormulaR1C1 = _
        "=HYPERLINK(""#SUMMARY!A1"",""HYPERLINK TO HOME"")"
    Range("C1").Select
    With Selection.Font
   
        .Name = "Times New Roman"
        .Size = 16
        Selection.Font.Italic = True
        Selection.Font.Bold = True
        Selection.Font.Underline = False
        .ColorIndex = xlAutomatic
                     
    End With
    With ActiveWindow
        .FreezePanes = False
        .SplitColumn = 0
        .SplitRow = 0
    End With
    ActiveSheet.Name = ActiveSheet.Range("B5")
        Range("A1").Select
End Sub
 
If you use the Search Box at the top right of this page you will find several posts related to opening all files in a directory
 
Back
Top