當須要處理集合成員的時候,通常會用這個,實際上就是處理對象spa
Sub foreachnext循環() Dim rng As Range, n! For Each rng In Sheet1.Range("a2:a6") If rng = "a1" Then rng.Interior.ColorIndex = 3 Next End Sub