View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson[_3_] Jim Thomlinson[_3_] is offline
external usenet poster
 
Posts: 983
Default three line program...

Find returns a range object. So you have to "Set" your variable = to that
range.

Sub test()
Dim Result As Range

Set Result = Sheet1.Cells.Find("1234")
If Not Result Is Nothing Then MsgBox Result.Value & vbTab & Result.Address
End Sub

HTH
"rci" wrote:

Hi all...

why would this fail?

Sheets("Sheet1").Select
Range("A1").Select
Result = Cells.Find("12345") '<-error


Runtime Error 91: Object variable or With block variable not set.

Many thanks!

Mike