ateneva
4/16/2017 - 4:17 PM

Quickly update the worksheet structure in multiple workbooks

Quickly update the worksheet structure in multiple workbooks

Sub TweakAllFiles()
Dim Cell As Range
Dim path As String
Dim file As String
Dim fullfilepath As String
'------------------------------------------------------------
'written by Angelina Teneva, 2017
'-----------------------------------------------------------
Application.DisplayAlerts = False
For Each Cell In ThisWorkbook.Worksheets("UCAS").Range("A2:A103")
    
    file = Cell.Value
    path = Cell.Offset(0, 6).Value
    fullfilepath = path & file
    
    If file Like "*2017*" Then

        Workbooks.Open Filename:=fullfilepath, ReadOnly:=False, UpdateLinks:=False
    
        With ActiveWorkbook
            With ActiveSheet
                Rows("1:5").EntireRow.Delete
                Columns("B:C").Replace "'", ""
            End With
            .Save
            .Close
        End With
    End If
    
Next Cell
Application.DisplayAlerts = True
End Sub