|
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ar, i&, iPosRow, iPosCol&
If Target.Address = "$G$10" Then
ar = Sheets("汇总表").UsedRange
For i = 3 To UBound(ar, 2)
If ar(1, i) = "" Then ar(1, i) = ar(1, i - 1)
If ar(1, i) = [E10] And ar(2, i) = [F10] Then
iPosCol = i
Exit For
End If
Next i
If iPosCol = 0 Then MsgBox "没找到对应项": Exit Sub
For i = 3 To UBound(ar)
If ar(i, 2) = [d10] Then
iPosRow = i
Exit For
End If
Next i
If iPosRow = 0 Then MsgBox "没找到对应项": Exit Sub
With Sheets("汇总表")
.Cells(iPosRow, iPosCol) = [G10]
Application.Goto .Cells(iPosRow, iPosCol)
End With
End If
End Sub |
评分
-
1
查看全部评分
-
|