roberttaekim
New Member
- Joined
- Jan 22, 2021
- Messages
- 8
- Office Version
- 365
- Platform
- Windows
- MacOS
Hi everyone. Hoping someone can help. I have this code which opens a file on the network and copy and pastes the content to a sheet and then opens the next file and copy and pastes to another sheet. How do i put some kind of on error resume so that if the first file cannot open because it is not available it just keeps going on to the next part of the code to open the next file and copy paste?
Really appreciate the help
Really appreciate the help
VBA Code:
Dim NmStr As String
NmStr = ActiveWorkbook.Name
Windows(NmStr).Activate
Report = Sheets("Documentation").Range("C5").Value
Workbooks.Open Filename:=Report
ActiveSheet.Cells.Copy
Windows(NmStr).Activate
Sheets("BS").Select
Range("A1").Select
ActiveSheet.Paste
Report = Sheets("Documentation").Range("C6").Value
Workbooks.Open Filename:=Report
ActiveSheet.Cells.Copy
Windows(NmStr).Activate
Sheets("IS").Select
Range("A1").Select
ActiveSheet.Paste