Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
gb gb is offline
external usenet poster
 
Posts: 2
Default Comparing two columns and listing differences

Hi

In summary, I have two columns (May and April) where the data in each cell
is a string of numbers, mostly all 10-digits long.

The aim was to compare data now (May) to the data from a month ago (April),
in order to work out what data is being queried now that wasn't being
queried one month ago. I hope that makes sense.

Whilst it could be possible to sift through the list and work out what
numbers are new, it would obviously be easier to have a piece of code that
would do it for me. The data I refer to above has been sorted out from a
wider batch of data and refined even further by other code that I use, so it
would make sense to complete the whole thing by means of code.

Anyway, could anyone assist in providing the code that would determine what
numbers exist in the May column that do not exist in the April column and
either:

(a) highlight the new numbers in the May column, or;
(b) copy the new numbers to another column or worksheet/book?

Thank you very much for any help you're able to provide

Thanks

gb


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 153
Default Comparing two columns and listing differences

Col A Col B
Last Month Data Current Month Data
(Start on current month data)

Sub Macro1()
Do Until ActiveCell.Value = ""
CurrentMonth = Value(ActiveCell.Value)
PriorMonth = Value(ActiveCell.Offset(0, -1).Value)
If CurrentMonth = PriorMonth Then
ActiveCell.Offset(0, 1).Select
ElseIf CurrentMonth < PriorMonth Then
'New value
Selection.Font.Bold = True
ElseIf CurrentMonth PriorMonth Then
'New value that did not exist in prior month
Selection.Font.Bold = True
End If
Loop
End Sub

Thanks
-----Original Message-----
Hi

In summary, I have two columns (May and April) where the

data in each cell
is a string of numbers, mostly all 10-digits long.

The aim was to compare data now (May) to the data from a

month ago (April),
in order to work out what data is being queried now that

wasn't being
queried one month ago. I hope that makes sense.

Whilst it could be possible to sift through the list and

work out what
numbers are new, it would obviously be easier to have a

piece of code that
would do it for me. The data I refer to above has been

sorted out from a
wider batch of data and refined even further by other

code that I use, so it
would make sense to complete the whole thing by means of

code.

Anyway, could anyone assist in providing the code that

would determine what
numbers exist in the May column that do not exist in the

April column and
either:

(a) highlight the new numbers in the May column, or;
(b) copy the new numbers to another column or

worksheet/book?

Thank you very much for any help you're able to provide

Thanks

gb


.

  #3   Report Post  
Posted to microsoft.public.excel.misc,microsoft.public.excel.programming,microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 3,885
Default Comparing two columns and listing differences

Hi
as a starting point:
http://www.cpearson.com/excel/duplic...tractingCommon
http://www.cpearson.com/excel/duplic...#InOneNotOther

--
Regards
Frank Kabel
Frankfurt, Germany


gb wrote:
Hi

In summary, I have two columns (May and April) where the data in each
cell is a string of numbers, mostly all 10-digits long.

The aim was to compare data now (May) to the data from a month ago
(April), in order to work out what data is being queried now that
wasn't being queried one month ago. I hope that makes sense.

Whilst it could be possible to sift through the list and work out

what
numbers are new, it would obviously be easier to have a piece of code
that would do it for me. The data I refer to above has been sorted
out from a wider batch of data and refined even further by other code
that I use, so it would make sense to complete the whole thing by
means of code.

Anyway, could anyone assist in providing the code that would
determine what numbers exist in the May column that do not exist in
the April column and either:

(a) highlight the new numbers in the May column, or;
(b) copy the new numbers to another column or worksheet/book?

Thank you very much for any help you're able to provide

Thanks

gb


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
Differences between columns Richard Excel Worksheet Functions 3 April 28th 09 01:04 PM
Comparing % Differences From in Pivot Tables Julia Excel Discussion (Misc queries) 2 October 17th 08 01:57 PM
Comparing text in cells for differences big john Excel Discussion (Misc queries) 4 August 27th 08 12:00 PM
Comparing two workbooks and highlighting the differences Charles C. Excel Discussion (Misc queries) 2 July 26th 06 07:14 PM
Comparing two data ranges for differences. jason.r.swinehart Excel Discussion (Misc queries) 0 January 12th 06 07:50 PM


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