ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   2 column sort (https://www.excelbanter.com/excel-programming/303602-2-column-sort.html)

LittleJoe

2 column sort
 
I have a 2 column worksheet like below but having hundreds of line
instead of these few.

Day 1
100.56
234.43-
405.43
6,506.00
1,304.00

Day 2
100.56
234.43-
405.43
6,506.00
1,304.00



What I need to do in Excel 2003:
Find any discrepencies between the columns.

1. Identify any items in column one which are not in column two.
2. Identify any items in column two which are not in column one.

Column 2 may arrive with several more items than it should, or severa
less.

I need a way to see what is extra or what is missing in column 2.

It is a real puzzler to me. Any code to help

--
Message posted from http://www.ExcelForum.com


Dave Peterson[_3_]

2 column sort
 
Chip Pearson has a bunch of techniques for working with duplicates at:
http://www.cpearson.com/excel/duplicat.htm

"LittleJoe <" wrote:

I have a 2 column worksheet like below but having hundreds of lines
instead of these few.

Day 1
100.56
234.43-
405.43
6,506.00
1,304.00

Day 2
100.56
234.43-
405.43
6,506.00
1,304.00

What I need to do in Excel 2003:
Find any discrepencies between the columns.

1. Identify any items in column one which are not in column two.
2. Identify any items in column two which are not in column one.

Column 2 may arrive with several more items than it should, or several
less.

I need a way to see what is extra or what is missing in column 2.

It is a real puzzler to me. Any code to help?

---
Message posted from http://www.ExcelForum.com/


--

Dave Peterson


MSP77079[_44_]

2 column sort
 
I pasted your two examples into cells C4:C9 and E4:E9.

You will need to change the fixed cell ranges to variable cell ranges.
Post again if you need help doing that.

Sub test()

For i = 5 To 9
thisValue = Cells(i, "C").Text
Range("E4:E9").Select
Selection.AutoFilter Field:=1, Criteria1:=thisValue
Selection.SpecialCells(xlCellTypeVisible).Select
Set myRange = Selection
NumFound = myRange.Cells.Count - 1
MsgBox "I found " & NumFound & " entries for "
thisValue
Next i

End Su

--
Message posted from http://www.ExcelForum.com


LittleJoe[_2_]

2 column sort
 
MSP77079 wrote:
*I pasted your two examples into cells C4:C9 and E4:E9.

End Sub *


Thanks for your help

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 04:14 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com