I’m suddenly struggling to find right VBA to get done with the job. A system creates every 2 minutes an Excel file like Error_2021.12.15_170909.xlsx
The user will select a cell in a Master-Sheet to populate the name of the source file and move it to the Backup Folder.
I find below some VBA examples but it should be added 3 conditions:
1-Select exact source file is created two minutes ago, without open file (maybe with VBscript).
2-Pop up inputbox to select the cell for source file name
3-After click on Ok, it should move the file to "C:\Backup\" folder.
Sub EnterFName() Dim FName As Variant FName = Dir("C:\TEMP\Error_*") While FName <> "" ActiveCell.Value = FName FName = Dir Wend End Sub
Thanks for the help