The following macro will go into the "Fin Review Team" tab of each of these files and copy G14:G29 and paste it into a blank sheet.
Well, it is supposed to paste it into a blank sheet. The problem is, when it pastes, nothing gets pasted, it is just blank.
What am I doing wrong here?
Thank you in advance!
Well, it is supposed to paste it into a blank sheet. The problem is, when it pastes, nothing gets pasted, it is just blank.
What am I doing wrong here?
Thank you in advance!
Code:
Sub Copy_files()
Dim MyPathName As String
Dim MyFileName As String
Dim NumChars As Long
Dim X As Long
Dim SummarySheet As String
Workbooks.Add
SummarySheet = ActiveWorkbook.Name
MyPathName = "C:\Users\Desktop\All/" 'Change this to the folder and filetypes you want to return
MyFileName = Dir(MyPathName)
X = 0
Do While MyFileName <> ""
X = X + 16
Workbooks.Open MyPathName & MyFileName, False
Application.DisplayAlerts = False
Sheets("Fin Review Team").Range("G14:G29").Copy
Workbooks(SummarySheet).Activate
Range("B" & X & ":B" & X).PasteSpecial xlPasteValuesAndNumberFormats
Range("B" & X & ":B" & X).PasteSpecial xlPasteFormats
Workbooks(MyFileName).Close False
MyFileName = Dir
Application.DisplayAlerts = True
Loop
End Sub
Last edited: