see if this helps Sub sort1()
Sheets(1).Range("a1:a" & Range("a1").End(xlDown).Row).Sort key1:=Sheets(1).Range("a:a"), order1:=xlAscending, Header:=xlYes Sheets(1).Range("b1:b" & Range("b1").End(xlDown).Row).Sort key1:=Sheets(1).Range("b:b"), order1:=xlAscending, Header:=xlYes Dim i As Long For i = 2 To Sheets(1).UsedRange.Rows.Count If UCase(Sheets(1).Cells(i, 1).Value) <> UCase(Sheets(1).Cells(i, 2).Value) And Sheets(1).Cells(i, 1).Value <> "" Then If Sheets(1).Cells(i, 1).Value > Sheets(1).Cells(i, 2).Value Then Sheets(1).Cells(i, 1).Insert Shift:=xlDown Else Sheets(1).Cells(i, 2).Insert Shift:=xlDown End If End If Next i End Sub On Tue, Feb 1, 2011 at 9:48 AM, Nathan <protoc...@gmail.com> wrote: > Hello all, > I'm hoping you will have time to assist me understanding how to best > tackle this comparison list shown at the following link. > > > https://docs.google.com/leaf?id=0B7Wrlvw2fV31ODliYzkwMWYtMzRhMi00OGU4LTliZTQtMzUxZDQ5OWQ2OGUy&hl=en&authkey=CJutsIkC > > I'm given a range similar to ("A1:B5") and need it to end up like > range ("D1:E6"). Basically I have two list and need to sort out and > add in blank cells to anything that does not match from either side. > > Thank you in advance for any bits of VBA or places to start my seach. > > -- > > ---------------------------------------------------------------------------------- > Some important links for excel users: > 1. Follow us on TWITTER for tips tricks and links : > http://twitter.com/exceldailytip > 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 > 3. Excel tutorials at http://www.excel-macros.blogspot.com > 4. Learn VBA Macros at http://www.quickvba.blogspot.com > 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com > > To post to this group, send email to excel-macros@googlegroups.com > > <><><><><><><><><><><><><><><><><><><><><><> > Like our page on facebook , Just follow below link > http://www.facebook.com/discussexcel > -- *Regards* * * *Ashish Koul* *akoul*.*blogspot*.com <http://akoul.blogspot.com/> *akoul*.wordpress.com <http://akoul.wordpress.com/> My Linkedin Profile <http://in.linkedin.com/pub/ashish-koul/10/400/830> P Before printing, think about the environment. -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel
Book1.xls
Description: MS-Excel spreadsheet