line up cells

QuietRiot

Well-known Member
Joined
May 18, 2007
Messages
1,079
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
  2. MacOS
I have a workbook with 2 groups of data on it side by side. Goal here is to have them line up. The problem is one side has more data then the other OR the smaller side may have data thats not in the larger side.

example:

Accnt #, Name, address Acct#, Name, address

I would like:

1234 Mike Thomas 1234 Mike Thomas
1234 Jayne Thomas 1234 Jayne Thomas
1235 Chris Beaton
1236 Susan Hamel 1236 Susan Hamel


any help
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Are there 3 columns or 2 columns in each group?
What are the column refs?

Can just one column in each group be used to match the groups?
If so what column?
 
Upvote 0
3 columns (actually more but if you can get 3 i'll tweak the code). There really is 10 on the left, 5 on the right

but account #, address are what I can use and should use to do compares

columns E and N = account # and is the only thing that would be suitable for matching. the address column is like 90% off by certain characters etc so I use a fuzzy match to validate. There is also same account numbers different names/addresses.

what i need is just to have the account #'s line up left/right
 
Upvote 0
I'll show you what i want in the next thread but this is a rough copy of what i have. only the real deal is like 24,000 rows. I left all this at work, im at home now so i just did it from memory.

*edit
PERSONAL.XLS
ABCDEFGHIJKLMNO
1FundAccountNewAcctNameAddressISNConfirmStatementAccountNameAddressConfirmStatement
210972223422234*name*add2343YN22234*name*addYN
31134111452522234*name*add2343YN123123*name*addYN
422221123123123123*name*add2343YN123333*name*addYN
511071123333123333*name*add2343YN123333*name*addYN
610971134134134134*name*add2343YN134134*name*addYN
711422223441223441*name*add2343YN223441*name*addYN
811111231234223441*name*add2343YN313414*name*addYN
910972234241223441*name*add2343YN323424*name*addYN
10112333313414313414*name*add2343YN334143*name*addYN
1110972323424323424*name*add2343YN335454*name*addYN
12120722334143334143*name*add2343YN4414334*name*addYN
131097335454335454*name*add2343YN4414334*name*addYN
1410974414334414334*name*add2343YN
Sheet1
 
Upvote 0
the main issue is that I have duplicate accounts so i want it lined up like this.
PERSONAL.XLS
ABCDEFGHIJKLMNO
1FundAccountNew AcctNameAddressISNConfirmStatementAccountNameAddressConfirmStatement
210972223422234*name*add2343YN22234*name*addYN
31134111452522234*name*add2343YN
422221123123123123*name*add2343YN123123*name*addYN
511071123333123333*name*add2343YN123333*name*addYN
6123333*name*addYN
710971134134134134*name*add2343YN134134*name*addYN
811422223441223441*name*add2343YN223441*name*addYN
911111231234223441*name*add2343YN
1010972234241223441*name*add2343YN
11112333313414313414*name*add2343YN313414*name*addYN
1210972323424323424*name*add2343YN323424*name*addYN
13120722334143334143*name*add2343YN334143*name*addYN
141097335454335454*name*add2343YN335454*name*addYN
1510974414334414334*name*add2343YN4414334*name*addYN
164414334*name*addYN
Sheet1
 
Upvote 0
i think the best way of doing this would be to count the number of times the account is on one side and compare to the number of times its on the other side.

look down account column on left side.. account is there 3 times look on account column right side.. account is there 2 times then Range("bla blarightside").Insert Shift:=xlDown if account is there 4 times then Range("bla blaleft side").insert shift:=xlDown
 
Upvote 0
I notice that the account numbers in the second group are sometimes old numbers and sometimes new numbers.

This makes it a bit complicated if the account number + the name is to be used for matching.

Is there not a column other than the account number that can be used for matching the two groups?

Do you really need the groups lined-up side by side?
There might be easier ways of identifying duplicate records by combining the lists into one list and then identifying the duplicates via a few formulas in adjacent columns.

i think the best way of doing this would be to count the number of times the account is on one side and compare to the number of times its on the other side.

look down account column on left side.. account is there 3 times look on account column right side.. account is there 2 times then Range("bla blarightside").Insert Shift:=xlDown if account is there 4 times then Range("bla blaleft side").insert shift:=xlDown

It's not quite as easy as you seem to think.
 
Upvote 0
new account and Account are matching account #'s

the other account on the left side is not needed since the new account was taken from that by grabbing the Right 6 digits
 
Upvote 0
The following doesn't do exactly what you requested, but it might be helpful as a start from which further manipulation can be done if required.

Code:
Dim rng As Range, area As Range
Application.ScreenUpdating = False
[N:N].Insert
Range([K2], [K65536].End(xlUp)).Resize(, 6).Cut [C65536].End(xlUp)(2)
Set rng = Range([C2], [C65536].End(xlUp)).Offset(, -2)
rng.EntireRow.Sort Key1:=[C2], Order1:=xlAscending
For Each area In rng.SpecialCells(xlCellTypeBlanks).Offset(, 2)
    area.Resize(, 8).Insert Shift:=xlToRight
Next
[N:N].Delete
Application.ScreenUpdating = False
 
Upvote 0

Forum statistics

Threads
1,214,388
Messages
6,119,229
Members
448,879
Latest member
VanGirl

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