[VBA問題] 儲存格範圍是B1:H65536,處理順序是從B1,C1,...H1,B2..依此類推。若C2到G5的值都是66,I1就會顯示C1跟G1的值 請問VBA該如何定義?

2016-09-29 4:39 am

回答 (2)

2016-09-29 11:21 am
✔ 最佳答案
Sub my_check()

Columns("I:I").ClearContents

For i = 2 To 65536
S = 0

For j = 3 To 7
If Cells(i, j) = 66 Then
S = S + 1
End If
Next

If S = 5 Then
Cells(i - 1, 9) = [C1] & "," & [G1]
End If
Next

End Sub
2016-10-13 9:05 am
網上查


收錄日期: 2021-05-02 14:19:46
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20160928203908AAol5j6

檢視 Wayback Machine 備份