Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.