#4です。
Sub Test1()
Dim i As Integer, ws As Worksheet, c
Dim fAddress, fw As String
fw = Application.InputBox("検索文字を指定", "検索", Type:=2)
If fw = "" Then Exit Sub
For i = ActiveSheet.Index To Worksheets.Count
Set ws = Worksheets(i)
With ws.Cells
Set c = .Find(fw, LookIn:=xlValues)
If Not c Is Nothing Then
fAddress = c.Address
Do
ws.Activate: c.Activate
If MsgBox("次を検索しますか?", vbYesNo _
+ vbQuestion, "検索") = vbNo Then Exit For
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> fAddress
End If
End With
Next i
End Sub
通常の検索ダイアログも使う別パターン
ただし、非常に使いづらい
別シートを続けて検索する時は「閉じる」
途中で検索を打切る時は「×」
Sub Test2()
Dim fw As String, i As Integer
fw = Application.InputBox("検索文字を指定", "検索", Type:=2)
If fw = "" Or fw = "False" Then Exit Sub
For i = ActiveSheet.Index To Worksheets.Count
Worksheets(i).Activate
Worksheets(i).Cells.Select
If Application.Dialogs(xlDialogFormulaFind).Show(fw) _
= False Then
ActiveCell.Select: Exit For
End If
ActiveCell.Select
Next i
End Sub
お礼
ありがとうございます。 Sub Test1()でいけそうです。