Created
February 21, 2018 02:15
-
-
Save DuongAQ/e74989fe4fbad8b386505e3f81b6911d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub ExportData_Test() 'Trích xuất dữ liệu vào Workbook khác | |
Dim owb As Workbook | |
Dim sh As Worksheet | |
'Xác định vùng dữ liệu cần trích xuất | |
Set sh=Sheet1 | |
sh.Range("A1:F100").Copy | |
'Mở Workbook cần lấy dữ liệu | |
Set owb=Workbooks.Open("C:\Test\England.xlsm") | |
'Dán nội dung cần trích xuất vào workbook vừa được mở | |
owb.Sheets("Data").Range("A1").PasteSpecial xlPasteValues | |
'Đóng Workbook cần lấy dữ liệu, lưu ý là có Save khi đóng | |
owb.Close True | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment