0

マクロが特定の行で問題のテキストを検索できるようにして、その行だけを検索し、他の行を検索しないようにしたいと考えています。たとえば、「dave」と入力すると、行 E で「dave」のみが検索されます。

Dim Answer, Reply
Dim b As Range

Answer = Application.InputBox("Enter the text to search for.", "Search Tool")

With Rows

  Set c = .Find(Answer, LookIn:=xlValues)

    If Not c Is Nothing Then
        firstAddress = c.Address
          Do
          Reply = MsgBox("Has this piece been edited? " & c.Address & _
          " which has a value of " & c.Value & "?", vbQuestion + _
          vbYesNoCancel, "Cell Hi-Liter")

            If Reply = vbYes Then
             c.Select
             Selection.Copy
             Selection.Offset(0, 1).Select
             ActiveSheet.Paste
             Exit Do
            End If

             Set c = .FindNext(c)
             Loop While Not c Is Nothing And c.Address <> firstAddress

                Else
                   MsgBox "Your search text was not found.", vbOKOnly, "Text Not Found"
      End If

End With


End Sub

どうすればこれを達成できますか?

4

1 に答える 1