TheWennerWoman
Active Member
- Joined
- Aug 1, 2019
- Messages
- 271
- Office Version
- 365
- Platform
- Windows
Hello,
The end user selects two files which populate two cells in my workbook, named ranges file_1 and file_2. These aren't just filenames, they also include the full filepath.
I want to start moving data between the two files but have come up with an "Object Required" error. This is my code, can anyone see what I'm doing wrong?
Thanks in advance!
The end user selects two files which populate two cells in my workbook, named ranges file_1 and file_2. These aren't just filenames, they also include the full filepath.
I want to start moving data between the two files but have come up with an "Object Required" error. This is my code, can anyone see what I'm doing wrong?
Code:
Sub open_files()
Application.ScreenUpdating = False
File_1 = Range("file_1").Value
File_2 = Range("file_2").Value
Workbooks.Open Filename:=File_1
Workbooks.Open Filename:=File_2
File_1.Activate '<----this line is the problem
Columns("A:A").Copy
End Sub
Thanks in advance!