- ©«¤l
- 5
- ¥DÃD
- 1
- ºëµØ
- 0
- ¿n¤À
- 18
- ÂI¦W
- 0
- §@·~¨t²Î
- WIN7
- ³nÅ骩¥»
- OFFICE2003
- ¾\ŪÅv
- 10
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-7-3
- ³Ì«áµn¿ý
- 2024-7-3
|
RE: ½Ð±Ð¦p¦ó´M§ä»·ºÝºÏºÐ¤¤excelÀɮפu§@ªíµ²ªG
name.rar (15.44 KB)
¤U±°ò¥»¤W¥i¥H¥N´À§Únªºµ²ªG
¥u¬O·Q½Ð¦U¦ì¤j¤jÀ°¦£¬Ý¤@¤U
¦pªG§Únªºµ²ªG¤£¬On¥H³sµ²ªºÅã¥Ü¦Ó¬Onª½±µ¨q¥Xµ²ªG¸Ó«ç»òקï
¥t¥~°²³]¨S¦¬´M¥Xµ²ªG ·|¤@ª½¥X²{¿ù»~¦b ³Ì«á±ªº End If ½ÐÀ°¦£¬Ý¬Ý
Sub QuickSearch()
Dim wks As Excel.Worksheet
Dim rCell As Excel.Range
Dim szLookupVal As String
szLookupVal = InputBox("key in", "key in msg", "")
If szLookupVal = "" Then Exit Sub
Application.ScreenUpdating = False
Application.DisplayAlerts = False
For Each wks In ActiveWorkbook.Worksheets
If wks.Name = "Result" Then
wks.Delete
End If
Next wks
Sheets.Add ActiveSheet
ActiveSheet.Name = "Result"
With Cells(1, 1)
.Value = "¤U±¤]¦³©Ò»Ýn¸ê°T" & szLookupVal
.EntireColumn.AutoFit
.HorizontalAlignment = xlCenter
End With
ActiveSheet.Next.Select
i = 2
For Each wks In ActiveWorkbook.Worksheets
With wks.Cells
Set rCell = .Find(szLookupVal, , , xlWhole, xlByColumns, xlNext, False)
If Not rCell Is Nothing Then
szFirst = rCell.Address
Do
rCell.Hyperlinks.Add Sheets("Result").Cells(i, 1), "", "'" & wks.Name & "'!" & rCell.Address
Select Case bTag
Case True
rCell.Interior.ColorIndex = 19
End Select
Set rCell = .FindNext(rCell)
i = i + 1
Loop While Not rCell Is Nothing And rCell.Address <> szFirst
End If
End With
Next wks
Set rCell = Nothing
If i = 2 Then
MsgBox "©Òn¬d§äªºÈ{" & szLookupVal & "}¦b¤u§@ªí¤¤¨S¦³", 64, "§ä¤£¨ì³á"
End If
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub |
|