'I'm having problem finding exact match using range.find

I have a list of products, each with a code. If I search for "281", for example, it should return the product's 281 row. The problem is, if I have another product code like "2811" before "281" (by rows), my code returns 2811's row.

precorow = Worksheets("PRODUTOS").Range("A:A").Find(Item, SearchOrder:=xlByRows).Row

I've tried using LookAt:=xlwhole, but it returned me the error "variable is not defined" (Error 91).

precorow = Worksheets("PRODUTOS").Range("A:A").Find(Item, lookat:=xlwhole, SearchOrder:=xlByRows).Row

Tried using DIM as Long then SET, now, error is "Object is required"



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source