Skip to content

Instantly share code, notes, and snippets.

@ateneva
Last active February 18, 2018 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ateneva/6412d9aedc0c3898ea3283581f8a7700 to your computer and use it in GitHub Desktop.
Save ateneva/6412d9aedc0c3898ea3283581f8a7700 to your computer and use it in GitHub Desktop.
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