jippii,
The way the macro is setup, it only finds a value greater than what is in I3. If there is no value greater than I3, it simply doesn't update I4. Its not actually returning a value. Since 100 is higher than the highest value of Motorcycle at 60, the macro finds no match and ends. If a value is entered that is higher than the highest and you need that to return the highest value (so entering 100 would return Motorcycle), use this updated code:
I also included a LastRow variable. Set that to the lastrow containing data that you want the macro to look through. Right now its set to end at row 30. So if the macro does not find any matches, then it will simply return the item at row 30. To get it to work with your sample data, you'd have to change LastRow to 14, since the sample data starts on row 10 and ends at row 14.
Hope that helps,
~tigeravatar
Bookmarks