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
 
This is probably quicker (no looping) :-

Code:
Dim rng As Range, area As Range
Application.ScreenUpdating = False
[N:N].Insert
Range([K2], [K65536].End(xlUp)(1, 6)).Cut [C65536].End(xlUp)(2)
Set rng = Range([C2], [C65536].End(xlUp)).Offset(, -2)
rng.EntireRow.Sort Key1:=[C2], Order1:=xlAscending
Range([C2], [C65536].End(xlUp)(1, 6)).Copy [K2]
[Q2] = 1
Set rng = Range([C2], [C65536].End(xlUp))
rng.Offset(, 14).DataSeries Rowcol:=xlColumns, Type:=xlLinear, Step:=1
rng.EntireRow.Sort Key1:=[A2], Order1:=xlAscending, Header:=xlNo
Range([B65536].End(xlUp)(2, 2), [C65536].End(xlUp)(1, 6)).ClearContents
Range([K2], [B65536].End(xlUp)(1, 15)).ClearContents
rng.EntireRow.Sort Key1:=[Q2], Order1:=xlAscending, Header:=xlNo
[N:N,Q:Q].Delete
Application.ScreenUpdating = False
 
Upvote 0

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
Thanks for you help, ill take a look later having issues getting it to work right now though.

the actually columns now that im at work from A to P

CO, fund&acct, Fund, Acct, NEW ACCT, INPA Name & Address, int-party stmt, in-party-confirm, isn, [J empty column],[k empty column], [l empty column], AccountNumber, CustomerName, INPA Name & Address, FormCategory

where JKL seperate left side form right side and NEW ACCT and AccountNumber are the criteria to line up
 
Upvote 0

Forum statistics

Threads
1,215,067
Messages
6,122,949
Members
449,095
Latest member
nmaske

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