多了一个row Sub CX() Application.ScreenUpdating = False Sheet1.Rows("8:94").Select Selection.EntireRow.Hidden = False With Sheet1 x = InputBox("请输入姓名", "查询") For Each c In Range("A8:A" & [a65536].End(xlUp).Row) If c <> x Then c.EntireRow.Hidden = True End If Next c End With Application.ScreenUpdating = True End Sub |