View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default search word or text in excel spreadsheet

Try this:

Sub louis()
Dim s As String
Set r = Intersect(Range("A:A"), ActiveSheet.UsedRange)
Set r2 = Nothing
s = Application.InputBox(prompt:="enter string:", Type:=2)
For Each rr In r
If rr.Value = Replace(rr.Value, s, "") Then
Else
If r2 Is Nothing Then
Set r2 = rr
Else
Set r2 = Union(r2, rr)
End If
End If
Next

If r2 Is Nothing Then
MsgBox ("Nothing Found")
Else
r2.Select
End If
End Sub

--
Gary''s Student - gsnu200765


"Louis" wrote:

Hello

Could somebody help me.

how could i find in the colomn A with an input box one word or sentence
writen in the input box.

Thanks for your help

Louis