sub 測試()
dim i as integer,j as integer,TArray()
For j = 1 To 10
Select Case Cells(1, j)
Case Is = "ABC"
TArray(i) = Cells(1, j)
i = i + 1
Case Is = "DDD"
TArray(i) = Cells(1, j)
i = i + 1
Case Is = "EEE"
TArray(i) = Cells(1, j)
'這裡找到時就直接跳離
'打完文才發現..我好像直接給他XX for 就好,又變成自問自答了..這裡可刪文嗎
exit for
end select
next
end sub
'大致就是這般...懶得再打..
然後當 找到字為"EEE"時就讓他直接離開select case
網查查得可用exit select
但我試了下,執行只會在該列陳述式顯示

難道只能用其它判別條件來令其在滿足條件時,直接給跳離嗎?
因為欄位還挺大的.(不是該例中的10次)...所以令其直接跳離給提高效率..謝謝各位。




























































































