Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I am trying to sort columns so that data will match up but I am lost. Below
is an example of what I am trying to do. A B C 1 2 2 Data Follows B 3 4 4 Data Follows B 5 5 Data Follows B 9 9 Data Follows B 10 15 16 16 Data Follows B 18 44 44 Data Follows B 66 The numbers in column A are going to be in numerical or alphabetical order and the data in B will line up wherever it is found in A. A and B will never duplicate each other. C data will follow wherever B Goes. If you can help I would greatly appreciate it. Thanks Jeremy |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]() Have a look at help for the VLOOKUP function. This might be what you need. -- mrice Research Scientist with many years of spreadsheet development experience ------------------------------------------------------------------------ mrice's Profile: http://www.excelforum.com/member.php...o&userid=10931 View this thread: http://www.excelforum.com/showthread...hreadid=563567 |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Hi Jeremy,
If you prefer a macro try this out on a backup copy of your sheet... Public Sub LineThemUp() Dim iLastRowA As Long iLastRowA = Range("A" & Range("A:A").Rows.Count).End(xlUp).Row Dim iLastRowB As Long iLastRowB = Range("B" & Range("B:B").Rows.Count).End(xlUp).Row Dim iRowA As Long Dim iRowB As Long For iRowA = iLastRowA To 1 Step -1 For iRowB = iLastRowB To 1 Step -1 If Cells(iRowB, 2).Value = Cells(iRowA, 1).Value Then Let Range(Cells(iRowA, 2), Cells(iRowA, 3)).Value = _ Range(Cells(iRowB, 2), Cells(iRowB, 3)).Value Range(Cells(iRowB, 2), Cells(iRowB, 3)).ClearContents Exit For End If Next iRowB Next iRowA Ken Johnson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
MATCHING COLUMNS | Excel Discussion (Misc queries) | |||
Column matching - sorting. Fairly hard problem, I think. | Excel Discussion (Misc queries) | |||
Matching 2 text columns | Excel Discussion (Misc queries) | |||
Matching and aligning columns | Excel Worksheet Functions | |||
Filtering Columns to Align Matching Data | Excel Worksheet Functions |