alex
alex

Reputation: 37

VBA - Find value from range of formulas

I have this line of code that is supposed to find the same value in a range:

Set RowN = oldDashboard.Sheets("Dom").Range("F1:F1000").Find(this.Sheets("Domestic").Range("A" & i).Value)

It works fine when my range is composed of values but when the range is composed of formulas it does not work. I tried putting .Value after Range("F1: F1000") but it brings an error. I think the answer is fairly simple but I cannot figure it out.

Thanks

Upvotes: 1

Views: 3125

Answers (1)

shrivallabha.redij
shrivallabha.redij

Reputation: 5902

You are not using all arguments that .Find method offers.

It is possible to search by formula (xlFormulas) or values(xlValues)

Example:

Set RowN = oldDashboard.Sheets("Dom").Range("F1:F1000").Find(What:=Shee‌​ts("Domestic").Range‌​("A" & i).Value, LookIn:=xlFormulas)

Upvotes: 2

Related Questions