Sub chaxun()
Sheet1.Range("d20").ClearContents
? On Error Resume Next
? ? For i = 2 To Sheets.Count
? ? ? ? Sheet1.Range("d14") = Application.WorksheetFunction.VLookup(Range("d9"), Sheets(i).Range("a:j"), 5, 0)
? ? ? ? Sheet1.Range("d16") = Application.WorksheetFunction.VLookup(Range("d9"), Sheets(i).Range("a:j"), 6, 0)
? ? ? ? Sheet1.Range("d18") = Application.WorksheetFunction.VLookup(Range("d9"), Sheets(i).Range("a:j"), 3, 0)
? ? ? ? Sheet1.Range("d20") = Application.WorksheetFunction.VLookup(Range("d9"), Sheets(i).Range("a:j"), 8, 0)
? ? ? ? Sheet1.Range("d22") = Sheets(i).Name
? ? ? ? If Sheet1.Range("d20") <> "" Then
? ? ? ? ? Exit For
? ? ? ? End If
? ? Next
End Sub
Sub tongji()
? ? Dim i As Integer
? ? Dim k As Integer
? ? Dim x As Integer
? ? Dim y As Integer
? ? For i = 2 To Sheets.Count
? ? ? ? k = k + Application.WorksheetFunction.CountA(Sheets(i).Range("a:a"))-1
? ? ? ? x = x + Application.WorksheetFunction.CountIf(Sheets(i).Range("f:f"), "男")-1
? ? ? ? y = y + Application.WorksheetFunction.CountIf(Sheets(i).Range("f:f"), "男")-1
? ? Next
? ? Sheet1.Range("d26") = k
? ? Sheet1.Range("d27") = x
? ? ? Sheet1.Range("d28") = y
End Sub