Reputation: 37
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
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:=Sheets("Domestic").Range("A" & i).Value, LookIn:=xlFormulas)
Upvotes: 2