LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Getting duplicate names

I'm going through a list of data that I sort from highest to lowest ratings
depending on what category their in, A, B, C.... That part works fine. I then
attempt to match up names with the ratings by looping through and finding a
match to these ratings. I then concatenat the last name and first name and
place in adjacent cell. Everything works except when it comes across two
ratings that are equal. Two samples were found to be exact in League B. The
first placed the names correctly but not the second, it duplicated the name
instead of searching further into the list. Below is both programming and a
sample output of what I have. I've changed the names to protect the innocent.
:)

Sub Name_to_MVP_Player()
'
' Concatenate First name Last name

Dim myobject As Range
Dim z As Long
Dim i As Long
Dim y As Long
Dim x As Long

For y = 15 To 21 Step 2
x = 3
Do While Cells(x, y) < ""
i = 3
z = 2

Do While Cells(i, 13) < ""
If Cells(x, y) = Cells(i, 13) Then
Cells(x, y - 1) = Cells(i, 4) & " " & Cells(i, 3)
Exit Do
End If
i = i + 1
Loop
End If
x = x + 1
Loop
Next
End Sub

Col N O P Q

League A League B
Jon B 2.25000 Tom W 2.75625
Mike B 2.14881 John W 2.59740
Frank B 1.78182 Jason K 2.59740
Jim W 1.75781 Ed M 2.53125
Ralph N 1.71429 Harry B 2.50694
Dave H 0.81667 Scott S 1.92857
Jason I 0.70000 Tony C 1.50000
Ray D 0.64286 Dennis A 1.40000
Mike S 0.62500 Vicky N 1.26042
Tim W 0.40909 Vicky N 1.26042
Bethann F 0.40000 Dave C 1.06667
Rodney E 0.28571 Connie D 1.01250

I would appreciate some help on this, thanks.
--
John
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Duplicate lettering in names Rocko Excel Discussion (Misc queries) 6 June 25th 09 05:24 AM
Deleting duplicate names law Excel Discussion (Misc queries) 4 December 4th 07 10:52 PM
Duplicate names George Excel Discussion (Misc queries) 0 November 19th 06 10:04 PM
How do you delete duplicate addresses, but keep duplicate names? Shelly Excel Discussion (Misc queries) 1 August 28th 06 10:36 PM
duplicate names Ada[_2_] Excel Programming 2 September 10th 03 11:43 PM


All times are GMT +1. The time now is 04:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"