Hi,
I want to match a set of database information by their ID column to another ID column with a different arrangement.
rayat_bb_sort.png
In the picture, I want to arrange ID2 to be like ID1.
Hi,
I want to match a set of database information by their ID column to another ID column with a different arrangement.
rayat_bb_sort.png
In the picture, I want to arrange ID2 to be like ID1.
Hi,
Welcome to the Forum.
Can you post the sample file in excel format instead of image? Remember to delete any confidential info before the upload.
Hello wolfrose,
I worked something basic up based on the image in your example. The code would obviously need quite a lot of customization to its location in your worksheet, but hopefully it helps.
Let me know if I can be of any further assistance,
DarkF1ame
Edit: I didn't create a button that makes use of the two macros...oversight on my part. The first moves the whole chunk of data other than id1 and then the second macro goes through and matches them up. I believe I wrote all of the "For" loops to be dynamic such that it will work no matter the length of data. All of the basepoints for ranges, column numbers, etc. would need to be customized by you.
Last edited by DarkF1ame; 11-14-2017 at 11:56 AM.
Mark as "Solved" and add Reputation if applicable.
Based on your picture from post #1, I would first put two empty columns between the username and id1 columns since the rows do not belong together.
You can then create a column to the right of the id1 column with 1, 2, 3, etc.
Then, create a second helper column (this time to the right of the username column) using a lookup formula (such as VLOOKUP or INDEX MATCH) to match the id columns and return the number from the first helper column (that is 1, 2, 3, etc.).
Then sort your data on the second helper column.
Here's a sample of the file.
Post #4 will do this for you. Now that I see the actual worksheet, I can be more specific.
Highlight column D > Home > Insert > Insert
In G2 type 1 and in G3 type 2. Highlight G2:G3 and drag the numbers down column G (this should produce 1 through 33 in column G starting in G2).
Now type "Helper Column" in D1 and then enter this formula in D2:
=INDEX(G:G,MATCH(C2,F:F,0))
Copy this formula down column D.
Highlight columns A:D > Data > Sort by: Helper Column > OK
Now you can delete your helper columns if you'd like.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks