Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sub BCTH_Export() 'Bai tap xuat du lieu tu file nay sang file khac
'Thiet lap cac bien
Dim MyWB As Workbook, NewWB As Workbook
Set MyWB = ThisWorkbook
Set NewWB = Workbooks.Add
'Lay du lieu
MyWB.Worksheets("Sheet1").Range("B1:C17").Copy
NewWB.Worksheets("Sheet1").Range("A1:B17").PasteSpecial Paste:=xlPasteColumnWidths
NewWB.Worksheets("Sheet1").Range("A1:B17").PasteSpecial Paste:=xlPasteValues
NewWB.Worksheets("Sheet1").Range("A1:B17").PasteSpecial Paste:=xlPasteFormats
NewWB.Activate
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment