Runtime Error

T

TomD

Can anyone advise as to why the following produces a
Runtime error 9; "Subscript out of range"

Dim FndRng1 As Range
Dim DivRng1 As Range

Set DivRng1 = ThisWorkbook.Sheets("Medal").Range
("D6:D705")

Set FndRng1 = DivRng1.Find(What:="1", _
After:=DivRng1.Cells(DivRng1.Cells.Count), _
LookIn:=x1Values, _
LookAt:=xlWhole)

If the LookIn statement is removed, no error. I'm
looking for a value returned from a formula in the cell.

Thanks

Tom
 
T

Tom Ogilvy

LookIn:=x1Values

should be

Lookin:=xlValues

see the difference - you have the number 1 as the second letter in the
constant and it should be the letter "L"
 
T

TomD

Tom,

Well Spotted !!!!

Glad I cut and pasted rather than typed.....

I couldn't (wouldn't) see it for looking

All Ok now. Thanks very much.

Tom
 
Top