0
誰能幫我弄清楚爲什麼這個代碼錯誤是「下標超出範圍」。 (運行時錯誤9)下標超出範圍VBA代碼
Dim arrayU() As Variant
Dim arrayX() As Variant
Dim arrayW() As Variant
Dim LrowU As Integer
Dim LrowX As Integer
Dim LrowW As Integer
Dim i As Integer
Dim j As Integer
Dim bed_in_use As Integer
For i = 3 To LrowX
For r = 3 To LrowW
For j = 3 To LrowX
If bed_in_use >= 24 Then Exit For
If arrayX(i) = arrayW(r) Then
bed_in_use = bed_in_use - 1
If arrayX(i) = arrayU(j) Then
bed_in_use = bed_in_use + 1
Cells(i, "Y").Value = bed_in_use
End If
End If
這將取決於你的數組聲明。顯示宣言行。作爲'昏暗arrayx(...' –
昏暗strDate 昏暗算作整數 昏暗arrayU()作爲變 昏暗arrayX()作爲變 昏暗arrayW()作爲變 昏暗LrowU作爲整數 昏暗LrowX作爲整數 Dim LrowW As Integer Dim i As Integer Dim j As Integer Dim bed_in_use As Integer – Zapata
不在評論中,請將它放在原始文章中 –