Hi all
I have Some data which looks like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Row[/TD]
[TD]Data[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Onions[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Onions[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Onions[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Potatoes[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Potatoes[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Potatoes[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Spring Onions[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]Spring Onions[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]Spring Onions[/TD]
[/TR]
</tbody>[/TABLE]
Im using the following vba code which isnt quite getting the right answer:
But the vba code is finding the Onions in "Spring Onions" and returns row 9, i need it to match contents exactly and return row 3 in the example above.
Can anyone help on adjusting this?
Thank you
I have Some data which looks like this:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Row[/TD]
[TD]Data[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Onions[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Onions[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Onions[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Potatoes[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Potatoes[/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]Potatoes[/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]Spring Onions[/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]Spring Onions[/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]Spring Onions[/TD]
[/TR]
</tbody>[/TABLE]
Im using the following vba code which isnt quite getting the right answer:
Code:
Set where = C.Find(what:="Onions", after:=C(1), searchdirection:=xlPrevious)
endrow = where.Row
But the vba code is finding the Onions in "Spring Onions" and returns row 9, i need it to match contents exactly and return row 3 in the example above.
Can anyone help on adjusting this?
Thank you