Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default comparing data


Hi,
I have 2 worksheets with intraday stock data containing the followin
data:
price, and deal hour (in minutes).
I want to compare the two worksheets and put in third worksheet all th
deals that were made in the same minute.
for example:
first work sheet
time price
10:01 100
10:05 101
10:07 102
10:10 103

second work sheet
time price
10:02 100
10:03 101
10:05 102
10:06 103
10:07 103

so i want excel to put in the third worksheet all the deals made in th
same minute:

time price
10:05 101
10:07 102

thank

--
kma
-----------------------------------------------------------------------
kman's Profile: http://www.excelforum.com/member.php...nfo&userid=333
View this thread: http://www.excelforum.com/showthread.php?threadid=48794

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default comparing data


try this macro

Sub macro1()
'need to define ranges on sheets 1 and 2
'define row range of sheet 1 data and sheet 2 data
sheet1startrow = Range("sheet1data").Row
sheet1endrow = Range("sheet1data").End(xlDown).Row
sheet2startrow = Range("sheet2data").Row
sheet2endrow = Range("sheet2data").End(xlDown).Row
'define matching times
Dim atime(100) As Double
Dim thistime As Double
For i = sheet1startrow To sheet1endrow
thistime = Sheets("sheet1").Cells(i, 1).Value
For h = sheet2startrow To sheet2endrow
If thistime = Sheets("sheet2").Cells(h, 1).Value Then GoTo found
Next h
GoTo nexttime
found:
'store times that match
j = j + 1
atime(j) = thistime
nexttime:
Next i
If j = 0 Then GoTo theend
'place data in columns 1 and 2 on sheet 3 beginning in row 3
For k = 1 To j
Sheets("sheet3").Cells(k + 2, 1).Value = atime(k)
Sheets("sheet3").Cells(k + 2, 2).FormulaR1C1 = _
"=VLOOKUP(RC[-1],Sheet1data,2,FALSE)"
Next k
theend:
End Sub


--
duane


------------------------------------------------------------------------
duane's Profile: http://www.excelforum.com/member.php...o&userid=11624
View this thread: http://www.excelforum.com/showthread...hreadid=487948

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default comparing data

Try this Add-in (Compare)
http://www.cpearson.com/excel/download.htm

This Add-In utility allows you to compare the contents of two workbooks. This was written by Myrna Larson and Bill Manville.


--
Regards Ron de Bruin
http://www.rondebruin.nl


"kman" wrote in message
...

Hi,
I have 2 worksheets with intraday stock data containing the following
data:
price, and deal hour (in minutes).
I want to compare the two worksheets and put in third worksheet all the
deals that were made in the same minute.
for example:
first work sheet
time price
10:01 100
10:05 101
10:07 102
10:10 103

second work sheet
time price
10:02 100
10:03 101
10:05 102
10:06 103
10:07 103

so i want excel to put in the third worksheet all the deals made in the
same minute:

time price
10:05 101
10:07 102

thanks


--
kman
------------------------------------------------------------------------
kman's Profile: http://www.excelforum.com/member.php...fo&userid=3337
View this thread: http://www.excelforum.com/showthread...hreadid=487948



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
comparing 2 data reza Excel Discussion (Misc queries) 7 May 6th 10 08:12 AM
comparing two columns of data and return unique data in another co ExcelUSER Excel Discussion (Misc queries) 6 June 18th 09 02:10 PM
help comparing two sets od data to find the odd data matsgullis Excel Worksheet Functions 2 January 12th 06 01:52 AM
comparing lists of data to remove duplicate data Tom Excel Discussion (Misc queries) 2 October 13th 05 06:16 PM
Comparing data in two columns and highlighting the data David Kinsley Excel Worksheet Functions 6 January 4th 05 06:01 PM


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

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"