Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Application.ScreenUpdating = False
- Application.AskToUpdateLinks = False
- Application.DisplayAlerts = False
- With Application.FileDialog(msoFileDialogFilePicker)
- .Title = "Please select a folder"
- .Show
- .AllowMultiSelect = False
- If .SelectedItems.Count = 0 Then 'If no folder is selected, abort
- MsgBox "You did not select a folder"
- Exit Sub
- End If
- MyFolder = .SelectedItems(1) & "" 'Assign selected folder to MyFolder
- End With
- MyFile = Dir(MyFolder) 'DIR gets the first file of folder
- While MyFile <> ""
- Set wbk = Workbooks.Open(filename:=MyFolder, UpdateLinks:=False)
- Application.AutomationSecurity = msoAutomationSecurityLow
- wbk.Activate
- ws.Select
- ws.Copy after:=Workbooks("SCAR_Tool.xlsm").Sheets(6)
- ws.Name = "JCAVSPersonnelByEligibilityAndA"
- wbk.Close savechanges:=True
- Wend
Add Comment
Please, Sign In to add comment