Private Sub Worksheet_Change(ByVal Target As Range)
'MsgBox
If Target.Address = "$A$1" Then
vl = Cells(Target.Row, Target.Column)
xr = Target.Row: xc = Target.Column
If Len(vl) = 0 Then Exit Sub ''空值退出
On Error Resume Next
x = ActiveSheet.Name
'MsgBox x
For Each Sh In ThisWorkbook.Sheets
If Sh.Name = x Then GoTo a_next
y = Sh.Name
'MsgBox y
Set sj = Worksheets(y)
ed = sj.[A65536].End(xlUp).Row
For i = 1 To ed
If sj.Cells(i, 1).Value = vl Then
Worksheets(x).Cells(xr, xc + 1) = sj.Cells(i, 2).Value
Exit For
End If
Next
a_next: Set sj = Nothing
Next
End If
End Sub
挺复杂