excel行列相符問題?

2016-05-24 9:50 am
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
Dim i As Integer
For i = 3 To 400
If Target.AddressLocal = "$B$" & i And Cells(i, 2) = Sheet2.Cells(i, 1) Then
Cells(i, 3) = Cells(i, 1)
End If
Next
End Sub
(i, 2)和Sheet2.Cells(i, 1)必需在同一行,請問怎麼寫才能就算不同行,一樣抓的到?謝謝

回答 (3)

2016-05-25 1:34 am
.
If Target.Column <> 2 Then End
For i = 3 To 400
If Cells(i, 2) = Sheet2.Cells(i, 1) Then Cells(i, 3) = Cells(i, 1)
Next

試試看!
2016-05-24 11:03 am
不行....
2016-05-24 10:17 am
是不是這樣
不同行cells(i+5,2)


收錄日期: 2021-05-03 13:44:30
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20160524015039AA0oZtg

檢視 Wayback Machine 備份