Merging two files with different time stamps

M

Matt S

This is what I have...

First file:
Time Time (min) Temp FTIR Data
2:33:52 0 250 8326
2:33:53 0.01668 250 9245
etc

Second File:
Time Time (sec) Time (min) MS Data
2:33:42.51703 0 0 344
2:33:43.22508 1.70805 0.02847 365
etc.

I need to match up the time stamp between the two files because my FTIR data
also has the temperature data, which my Mass Spec (MS) file doesn't. As you
can see, the Mass Spec file has a very random time stamp, which I work out
the number of seconds.

So, is there a way to combine the two files using possibly the number of
minutes/seconds of the test in a macro? If I go that route, I have to make
excel realize when both start.

Any help would be greatly appreciated!

Thanks,
Matt
 
M

Matt S

This is what I've come up with so far comparing the second data... the
runtime is a little slow, but it works.

Dim LastRow As Long
LastRow = Cells(Rows.Count, "N").End(xlUp).Row

i = 22

Do While i < LastRow

If Range("O" & i).Value < Range("D" & i).Value Then
Range("N" & i & ":Q" & i).Delete Shift:=xlUp
LastRow = Cells(Rows.Count, "N").End(xlUp).Row
Else: i = i + 1
End If
Loop

Now I have to figure out how to match up the initial times. Anyone know how
to speed up the calculations above?

Thanks,
Matt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top