|
代码如下。。。
Option Explicit
Sub 查找()
Dim lr%, h%, ws As Worksheet, dc$, i%, gzb$, rng As Range
Application.ScreenUpdating = False '关闭刷屏
Application.DisplayAlerts = False '关闭警告信息
lr = Cells(Rows.Count, 2).End(3).Row + 1
Range("B2:C" & lr).ClearContents
h = 2
For Each ws In ThisWorkbook.Worksheets
If ws.Name <> "控制台" Then
Cells(h, 2).Value = ws.Name
h = h + 1
End If
Next ws
dc = [A2]
i = 2
Do While Cells(i, 2) <> ""
gzb = Cells(i, 2)
Set rng = Sheets(gzb).UsedRange.Find(What:=dc, LookIn:=xlValues, LookAt:=xlWhole)
If Not rng Is Nothing Then Cells(i, 3) = "是"
i = i + 1
Loop
MsgBox "查找完毕!"
End Sub
|
|