Ananthak275
Board Regular
- Joined
- Aug 22, 2020
- Messages
- 128
- Office Version
- 2013
- Platform
- Windows
- MacOS
Hi everyone, I'm trying to create a VBA script that goes into file1 and copies the data into file2. File 1 contains the data.
The issue I'm having is file2 has more columns and not necessarily in the same order as the ones in file1. As well, the Range is wrong, it has a limit. How do i make sure it gets all the relevant rows per column in file1?
Here is my code;
The issue I'm having is file2 has more columns and not necessarily in the same order as the ones in file1. As well, the Range is wrong, it has a limit. How do i make sure it gets all the relevant rows per column in file1?
Here is my code;
Sub GetDatacClosedBook()
Dim src As Workbook
Set src = Workbooks.Open("C:\Users\Akh\Documents\file1", True, True)
ThisWorkbook.Activate
Worksheets("Sheet1").Range("B2:D3").Formula = src.Worksheets("Sheet1").Range("A1:C2").Formula
End Sub