Searching Multiple Times

butlerr

New Member
Joined
Aug 12, 2010
Messages
10
In column 'A' I have a list of 10 different people, but there are 130 entries, so a lot of repeating.

In column 'B' I have a list a items each person has chosen (nothing repeating)

Now in, say, column 'C' I want to list all items chosen by one particular person.

I can search for a name and find their first item, but I don't know how to find the 2nd occurrence of that persons name and entering its choice, and so on.

This is what I have for the first entry:
=VLOOKUP(G1,DraftingPlayer,2,FALSE)

"DraftingPlayer" is the name range for column A and B.
G1 is a cell that contains one of my names (Brett)

Any help would be much appreciated!
 
change these two things:

Rich (BB code):
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Application.ScreenUpdating = False
LR = Sheet2.Range("C" & Rows.Count).End(xlUp).Row
i = 7
With Sheet2.Range("C3:C" & LR)
Set c = .Find(Sheet3.Range("A1").Value, LookIn:=xlValues, lookat:=xlWhole)
If Not c Is Nothing Then
firstaddress = c.Address
Do
Sheet3.Cells(i, 3).Value = c.Offset(0, 1).Value
i = i + 1
Set c = .FindNext(c)
Loop While Not c Is Nothing And c.Address <> firstaddress
End If
End With
Application.ScreenUpdating = True
End Sub

everything else seems in tact with what i wrote
 
Upvote 0

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Ah man, I really appreciate you trying to help me out here, but I don't think it's going to work for me, I need to learn more about VBA first.

I put in your code, it kinda worked, but it placed the results in Column C, not in Column A, not sure where to change that. As well it placed the first result in C19 and the second result in C7, not sure why.

And once I figure this out, I have to do it 9 more times (for all of my names), so I wouldn't know the process there.

If you feel like not helping out anymore I completely understand. I'm not trained well enough yet.
 
Upvote 0
for that, change the i=3 in this line: Sheet3.Cells(i, 3).Value = c.Offset(0, 1).Value with corresponding column index.

Col a = 1, Col b = 2, etc
 
Upvote 0
ok, got it to work now. except it is putting the first result at the bottom of the list. Do you know how to put it at the top?

and once we have that, Do I just copy and paste this 9 more times in the same page. I think there would be a few small other changes, but can you put 10 different codes in the same sheet?
 
Upvote 0

Forum statistics

Threads
1,216,084
Messages
6,128,730
Members
449,465
Latest member
TAKLAM

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