Hi all,
I am a new poster on this forum. I tried getting help from another forum but no one there has offered any help for days now. My problem is this: I run an online baseball league, and the game I use to simulate our games has issued a new version which has updated ratings for all the baseball players. I have exported rosters from the new game and rosters from my online league to .csv files and what I want to do is find which players are duplicates in both files and line them so that I can scroll both files simultaneously and update my online league file easily. I also want the non-duplicate players to be sorted below the duplicates so I can deal with them later. Someone on the other forum posted some dynamic named range code and two macros and gave me some vague instructions on how to use the codes. I have posted the codes below with their instructions:
In both:
a) There're defined 2 dynamic named ranges:
"DataTable" as: =DESREF(INDIRECTO(DIRECCION(COINCIDIR("//Player ID";updated_rosters!$A:$A;0)+2;1;1;1;"ml_rosters"));;;CONTARA(updated_rosters!$A:$A)-CONTAR.SI(updated_rosters!$A:$A;">=//");CONTARA(INDIRECTO("updated_rosters!$"&COINCIDIR("//Player ID";updated_rosters!$A:$A;0)&":$"&COINCIDIR("//Player ID";updated_rosters!$A:$A;0)))) -----> in english: =OFFSET(INDIRECT(ADDRESS(MATCH("//Player ID",updated_rosters!$A:$A,0)+2,1,1,1,"updated_rosters")),,,COUNTA(ml_rosters!$A:$A)-COUNTIF(updated_rosters!$A:$A,">=//"),COUNTA(INDIRECT("updated_rosters!$"&MATCH("//Player ID",updated_rosters!$A:$A,0)&":$"&MATCH("//Player ID",updated_rosters!$A:$A,0))))
"DataUpdateTable" as: =DESREF(DataTable;0;25;56) -----> in english: =OFFSEF(DataTable,0,25,,56)
The changes in the now weird range definitions are due to the first and last lines like "//..." that altered the normal and usual worksheet like database structures.
b) In worksheet Sheet1 there's a procedure SortLinked in the VBA section:
-----
-----Please Login or Register to view this content.
c) There are 5 new columns ER:EV & ES:
ER1: title
ER2: Z (greater than below values for sorting descending because of damned row 2)
ER3 & down: =SI(ES3=0;"N";"Y") -----> in english: =IF(ES3=0,"N","Y")
ES1: title
ES3 & down: =SI.ERROR(COINCIDIR(A3;'[XXX.xlsm]Sheet1'!$A:$A;0);0) -----> in english: =IFERROR(MATCH(A3,'[XXX.xlsm]Sheet1'!$A:$A,0),0) (where XXX is the name of the other file)
ET1: title
ET3 & down: =E3&"_"&F3&"_"&K3&"_"&J3&"_"&I3&"_"&L3&"_"&N3
EU1: title
EU2: 0 (lesser than 1, for sorting ascending)
EU3 & down: =MIN(CONTAR.SI(ET$1:ET3;ET3);2) -----> in english: =MIN(COUNTIF(ET$1:ET3,ET3),2)
EV1: title
EV3 & down: "Y" if update, "" if not
In OBSL file (target) there's a module with a procedure UpdateLinked in the VBA section:
----- />
-----Please Login or Register to view this content.
Only once steps:
1) update your workbooks as described in a), b) & c)
2) define the named ranges in them as specified
Each time steps:
1) in both files run the procedure SortLinked
2) in target (OBSL) file run the procedure UpdateLinked
Just advise if any issue.
Regards!
PS: Remember that these files have crossed links, so if renaming happens you'd have to edit data links too.
PS2: I'm gonna take vacations of baseball (specially ML & OBSL) for a few, long, days. Good luck!
Here are my files if someone will please take a look at them and instruct me on how to use these codes. I have downloaded Spreadsheet Compare and KU Tools to try and figure this out but to no avail.
New rosters: https://www.dropbox.com/s/xdpk0bndan...ed_rosters.csv
Online league rosters: https://www.dropbox.com/s/8arhr605w4...sl_rosters.csv
Thanks,
Stacy
Bookmarks