Hi,
Below is a macro that copies a file. I'm also trying to include some additional instructions after the file is copied but I get a 'Run-time error 9' 'subscript out of range' on the 'Sheets("Report").Select', line.
I also would like some help adding additional code on file copy that would copy the latest file by date and time. The file name is always the same but the extension is different and it could be created several times a day.
Sub CopyFile()
'
' CopyFile Macro
'
FileCopy "C:\Documents and Settings\user\My Documents\Folder\Report_6.xls", "C:\Documents and Settings\user\Desktop\Folder\Report_6.xls"
Sheets("Report").Select
Sheets("Report").Name = "Sheet1"
ActiveWindow.SmallScroll ToRight:=2
Range("M1").Select
Selection.ClearContents
End Sub
Below is a macro that copies a file. I'm also trying to include some additional instructions after the file is copied but I get a 'Run-time error 9' 'subscript out of range' on the 'Sheets("Report").Select', line.
I also would like some help adding additional code on file copy that would copy the latest file by date and time. The file name is always the same but the extension is different and it could be created several times a day.
Sub CopyFile()
'
' CopyFile Macro
'
FileCopy "C:\Documents and Settings\user\My Documents\Folder\Report_6.xls", "C:\Documents and Settings\user\Desktop\Folder\Report_6.xls"
Sheets("Report").Select
Sheets("Report").Name = "Sheet1"
ActiveWindow.SmallScroll ToRight:=2
Range("M1").Select
Selection.ClearContents
End Sub