Skip to content

Instantly share code, notes, and snippets.

@ndthanh
Created December 27, 2016 14:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ndthanh/c1c9d38bf88b1d2072e55d12f20d0d77 to your computer and use it in GitHub Desktop.
Save ndthanh/c1c9d38bf88b1d2072e55d12f20d0d77 to your computer and use it in GitHub Desktop.
'https://www.hocexcel.online/vba-excel-doi-tuong-workbooks-worksheets-ranges.html
'dtnguyen | Học Excel Online
' Tham chiếu đến workbook hiện thời
ThisWorkbook
' Tham chiếu đến workbook đang làm việc
ActiveWorkbook
' Tham chiếu đến 1 Workbook đang mở
Workbooks("ten_workbook.xlsx")
'Mở 1 workbook
Workbooks.Open "C:\docs\book1.xlsx"
'Sử dụng biến với Workbook
Dim wk as Workbook
Set wk = Workbooks("ten_workbook.xlsx")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment