Last active
February 18, 2018 21:23
-
-
Save ateneva/6412d9aedc0c3898ea3283581f8a7700 to your computer and use it in GitHub Desktop.
Quickly update the worksheet structure in multiple workbooks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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