We are using VBA to open workbooks, copy and paste into another workbook then close the workbook. When initiating the code we get sub not defined. (Changed file and sheet names for security reasons)
Thank you in advance. (FYI we are learning VBA as we go and wanting to get better)
Here is the code:
Sub OpenWorkbook()
Workbooks.Open "Copy From File"
End Sub
Sub Copy_Method()
Workbooks("Copy From File").Worksheets("Sheet Name").Range("A1:G200").Copy _
Workbooks("Destination File").Worksheets("Sheet Name").Range("A1")
End Sub
Sub CloseWorkbook()
Workbooks("Copy From File").Close SaveChanges:=True
End Sub
Thank you in advance. (FYI we are learning VBA as we go and wanting to get better)
Here is the code:
Sub OpenWorkbook()
Workbooks.Open "Copy From File"
End Sub
Sub Copy_Method()
Workbooks("Copy From File").Worksheets("Sheet Name").Range("A1:G200").Copy _
Workbooks("Destination File").Worksheets("Sheet Name").Range("A1")
End Sub
Sub CloseWorkbook()
Workbooks("Copy From File").Close SaveChanges:=True
End Sub