Skip to content

Instantly share code, notes, and snippets.

@TGDUY
Created May 9, 2018 00:45
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 TGDUY/6733928021e3109d105c71be00019eb3 to your computer and use it in GitHub Desktop.
Save TGDUY/6733928021e3109d105c71be00019eb3 to your computer and use it in GitHub Desktop.
Sub MinhDang()
Dim StartDate As Date, TMP() As Date, Totalday As Long, I As Long
With Sheet1
StartDate = CDate(.Range("A1").Value)'Ngày bắt đầu tính từ ô A1
Totalday = CLng(.Range("B1").Value)' Số ngày cần điền
.Range("C1:C1048576").ClearContents 'Xóa dữ liệu cột C
For I = 1 To Totalday ' Vòng lăọ chạy từ 1 tới tổng số ngày
.Range("C" & I) = StartDate + I - 1 '' Điền dữ liệu vào cột C
Next
End With
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment