Nhờ các thành viên GPE giải thích ý nghĩa của code trong sổ báo giảng này giúp mình với! Cụ thể:
+ Ý nghĩa của biến.
+ Ý nghĩa của câu lệnh.
Public Function GetMon(t As Integer, d As Date, n As Integer, tkb As Range) As String
Dim r As Range
Dim nr As Integer
Dim i As Integer
Dim st As Integer
nr = 0
For Each r In tkb.Rows
nr = nr + 1
Next
i = 1
While (tkb.Cells(i + 1, 1).Value <> vbEmpty) And (tkb.Cells(i + 1, 1).Value <= d) And (i < nr)
i = i + 1
Wend
GetMon = UCase(Trim(tkb.Cells(i, (t - 2) * 10 + n * 2).Value))
End Function
+ Ý nghĩa của biến.
+ Ý nghĩa của câu lệnh.
Public Function GetMon(t As Integer, d As Date, n As Integer, tkb As Range) As String
Dim r As Range
Dim nr As Integer
Dim i As Integer
Dim st As Integer
nr = 0
For Each r In tkb.Rows
nr = nr + 1
Next
i = 1
While (tkb.Cells(i + 1, 1).Value <> vbEmpty) And (tkb.Cells(i + 1, 1).Value <= d) And (i < nr)
i = i + 1
Wend
GetMon = UCase(Trim(tkb.Cells(i, (t - 2) * 10 + n * 2).Value))
End Function
File đính kèm
Lần chỉnh sửa cuối: