LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default comparing 2 columns of numbers

what would be the best way to compare 2 columns of numbers?

the master list is downloaded every day. numbers may be added or deleted. i
would need to find just the ones that were added or deleted in the master list.

i wrote a routine that sorts and compares side by side numbers and if it finds
one, it changes the offset to the next row and continues on to the next row.

this seems to work fine for numbers that were added.

i just wondered if there was a better way to filter them out.


For Each cell In ws2.Range("A1:A" & lastrow3)
cell.Value = cell.Value * 1 'in case any are stored as text
cell.Offset(0, 1).Value = cell.Offset(0, 1).Value * 1 'in case any are
stored as text
If cell.Value < cell.Offset(0 - Cntr, 1).Value Then
Debug.Print cell.Address
Cntr = Cntr + 1
.Range("C" & Cntr) = cell.Value

End If
Next
--


Gary



 
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
Need help comparing 2 columns of number to find unique numbers BP Excel Worksheet Functions 3 January 11th 10 03:05 PM
Comparing 3 numbers [email protected] Excel Discussion (Misc queries) 10 May 18th 09 10:10 PM
Comparing two columns of numbers PaladinWhite Excel Worksheet Functions 2 June 1st 08 11:46 PM
comparing numbers in a sheet Rockbear Excel Discussion (Misc queries) 1 April 15th 08 06:16 PM
Comparing two columns of information with 2 new columns of informa cbuck Excel Discussion (Misc queries) 1 January 16th 07 09:49 PM


All times are GMT +1. The time now is 08:58 AM.

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

About Us

"It's about Microsoft Excel"