asyamonique
Well-known Member
- Joined
- Jan 29, 2008
- Messages
- 1,286
- Office Version
- 2013
- Platform
- Windows
Code:
Application.ScreenUpdating = False
Worksheets("1000").Visible = True
Workbooks.Open Filename:="C:\SHARING FILES\xxxxxx\exports\1000.xls"
Cells.Select
Selection.Copy
Windows("result.xls").Activate
Sheets("1000").Select
Cells.Select
ActiveSheet.Paste
Cells.EntireColumn.AutoFit
Sheets("Sheet1").Select
Windows("1000.xls").Activate
Application.CutCopyMode = False
ActiveWorkbook.Save
Windows("1000.xls").Activate
ActiveWindow.Close False
Worksheets("1000").Visible = False
ActiveWorkbook.Save
Application.ScreenUpdating = True
Good Day,
Is there any way to improve that code in regards if the needed file doesn't exist how can we disable to error notice.
I just trying to copy datas from closed workbooks with that code for each sheet of my master file...I beleive that im doing the wrong way but i have no choose to make it easier.
Destination folder has 12 files named with their created times(0600 to 0400 for every two hrs.)
How can i copy that files into my master file one by one from 0600 to 0400 with one click and also if there is missing file in it the code should ignore that and continue to finish the task after then i can load my userform accordingly.
Master file has 12 worksheets with the same file names.(0600 to 0400)
Many Thanks