Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 6
Default Sorting 2 colums to get numbers to match ?

example:
101 105 101
102 107 102
103 103
104 104
105 105 105
106 106
107 107 107




--
688
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,836
Default Sorting 2 colums to get numbers to match ?

I think this will do what you want (but it only works on two columns; A and B):

Sub Matching_Cell()
Dim rng As Range, cell As Range
Set rng = Range(Range("A1"), Range("A65536").End(xlUp))
Application.ScreenUpdating = False
For Each cell In rng
With cell
If .Offset(0, 1) = "" Then Exit For
If .Value < .Offset(0, 1).Value Then
..Offset(0, 1).Insert
ElseIf .Value .Offset(0, 1).Value Then
..Insert
End If
End With
Next
End Sub


Regards,
Ryan---


--
RyGuy


"thriller" wrote:

example:
101 105 101
102 107 102
103 103
104 104
105 105 105
106 106
107 107 107




--
688

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Sorting 2 colums to get numbers to match ?

This might work as well
Assuming source data in cols A and B as posted, from row1 down
In C1:
=IF(ISNUMBER(MATCH(A1,B:B,0)),A1,"")
Copy C1 down to the last row of data in col A
Col C returns the aligned results that you seek for the values in col B
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---
"thriller" wrote:
example:
101 105 101
102 107 102
103 103
104 104
105 105 105
106 106
107 107 107




--
688

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
sorting 2 colums of numbers and incremening them down blk&wht Excel Discussion (Misc queries) 10 October 9th 06 10:12 PM
MATCH 3 COLUMS RETURN 4TH Mike Excel Discussion (Misc queries) 1 October 8th 06 07:59 PM
Sorting Colums Kate000 Excel Worksheet Functions 2 April 4th 06 05:50 AM
Sorting colums Kate000 Excel Discussion (Misc queries) 3 April 4th 06 02:38 AM
match to colums vlookup JavyD Excel Discussion (Misc queries) 1 August 12th 05 02:07 AM


All times are GMT +1. The time now is 06:45 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"