Looping through a data set and retrieving values

Ronanm

Board Regular
Joined
Nov 13, 2010
Messages
107
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]1
[/TD]
[TD][/TD]
[TD][/TD]
[TD]Find[/TD]
[TD]Found[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD][/TD]
[TD][/TD]
[TD]2[/TD]
[TD]Red[/TD]
[TD]Clare[/TD]
[TD]Walker
[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD][/TD]
[TD][/TD]
[TD]3[/TD]
[TD]Black[/TD]
[TD]Paul[/TD]
[TD]Binns[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD][/TD]
[TD][/TD]
[TD]5[/TD]
[TD]Purple[/TD]
[TD]Sharon[/TD]
[TD]Codd[/TD]
[/TR]
[TR]
[TD]Result[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]
Blue

<tbody>
</tbody>
[/TD]
[TD]
John

<tbody>
</tbody>
[/TD]
[TD]
Smith

<tbody>
</tbody>
[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Red[/TD]
[TD]Clare[/TD]
[TD]Walker[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Black[/TD]
[TD]Paul[/TD]
[TD]Binns[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Pink[/TD]
[TD]David[/TD]
[TD]James[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Purple[/TD]
[TD]Sharon[/TD]
[TD]Codd[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]

Hi
Couldn't work out how to put this text above the table.

I want to have some code that loops through Column D ("Find"), matches the number in Column A and pulls out the three cells to the right of that (As shown). However the numbers in the column above the word "Result" get ignored and sometimes there is more or less that the four currently showing above the word "Result".

Thanks
 

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Why can't you just use VLOOKUP do this (no VBA or looping necessary)?
 
Upvote 0
Why can't you just use VLOOKUP do this (no VBA or looping necessary)?

Hi

I would do normally, but I will be looping through many thousands of rows, based on other conditions before I need to loop through this part of the data set.

Thanks
 
Upvote 0
I am not sure I understand what it is that you are after then, if not VLOOKUP. It doesn't really matter how mnay rows there are, VLOOKUP can handle thousands of rows.
If there are "other conditions" that need to be considered, I think we need more of those details to get a better understanding of what you are trying to do.
 
Upvote 0
I wanted code so that it could slip into a large piece of work I'm doing. Vlookup I've been using for over 20 year but it doesn't fit here. I've pulled something together that works for me, so I'm fine as it stands.
 
Upvote 0
I've pulled something together that works for me, so I'm fine as it stands.
Would you mind posting what you came up with?
I am curious to hear what you did (and hat may also help answer some of questions about the details that I had).
 
Upvote 0

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top