Runtime Error

  • Thread starter Thread starter TomD
  • Start date Start date
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
 
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"
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top