Sub d()
Dim j As Long, i As Long, name As String, wname As Worksheet, name1 As String, rng As Range, name2 As Range, a()
j = 2
Worksheets("出席统计").Activate
For j = 2 To 22
name = Cells(1, j).Value
Set wname = Worksheets(name)
Set rng = wname.Range(Cells(3, 2), Cells(3, 2).End(xlDown))
a = rng
i = 1
For i = LBound(a) To UBound(a)
Set name2 = Worksheets("出席统计").Cells.Find(name1)
If Not name2 Is Nothing Then
name2.Offset(0, j - 1).Value = "yes"
End If
Next i
Next j
这是程序