Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 184
Default Sorting columns and Matching

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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Sorting columns and Matching


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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,073
Default Sorting columns and Matching

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MATCHING COLUMNS JOE Excel Discussion (Misc queries) 0 May 3rd 06 05:51 PM
Column matching - sorting. Fairly hard problem, I think. A S-D Excel Discussion (Misc queries) 13 April 7th 06 01:52 PM
Matching 2 text columns Bill Oliman Excel Discussion (Misc queries) 1 February 24th 06 08:52 PM
Matching and aligning columns amerkarim Excel Worksheet Functions 2 September 24th 05 02:15 PM
Filtering Columns to Align Matching Data Casino Guy Excel Worksheet Functions 4 September 15th 05 04:47 AM


All times are GMT +1. The time now is 07:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"