我目前面臨如何在循環結束後確定數組大小的問題。以下是我對該特定功能的編碼。確定數組大小
Function analyse(ByVal work_date As Date, time As String, action As String, decision As Boolean, branch As String) As String
Dim sh As Worksheet
Dim att_time(6) As String
Dim dated(1) As Date
Set sh = Worksheets("shifthr")
lastrec = sh.Range("C" & Rows.Count).End(xlUp).Row
a = 1
For i = 2 To lastrec
dated(a) = work_date
If branch = sh.Cells(i, 1) Then
att_time(a) = time
a = a + 1
End If
Next i
If att_time(a) = 4 Then
ElseIf att_time(a) = 6 Then
End If
End Function
謝謝你們幫助的手。非常欣賞
數組的大小?但是你已經聲明瞭數組的大小? –
@SiddharthRout,循環完成後,我想檢測數據已經保存在數組中多少,並從那裏需要做一些分析。對不起,有任何困惑。 – user1928481
我以爲是這樣:)看到我的答案。 –