我想要做的是檢查值是否在兩列的值之間,如果值在裏面,那麼在單元格中放一個「1」,如果不是「0」,我艾爾雷試着繼續和下一個j,但它給了我一個「下一個沒有for」。我知道這有一個簡單的解決方案,但不勝感激。由於從嵌套循環內跳過
For i = 1 To ll
For j = 1 To t
If Cells(j + 1, 12).Value >= Cells(i + 1, 9).Value And Cells(j + 1, 12).Value< Cells(i + 1, 10).Value Then
Cells(j + 1, 13).Value = 1
Next j
Else
Cells(j + 1, 13).Value = 0
Next i
End If
`
嗯,你的if語句無法啓動內循環,並最終外面 – twoleggedhorse
使用的[壓頭(http://rubberduckvba.com/indentation)解決您的縮進:這些糾結塊錯誤會跳到你用壓頭。 –