PDA

View Full Version : 2 sheets, matching many:1 date fields, copy value if true



embeins
08-28-2008, 10:57 AM
I am new to VBA and, with the exception of taking some easy code and putting it into place, have no experience working with VBA. Your site/forum seemed the most logical place to post my question.

I am trying to figure out how to build a loop, or if/then, or whatever, to get the following to work:

In Sheet "08" I am using 2 columns: B (Date), K (empty)
In Sheet "Conv" I am using 2 columns: A (Date), F (calculated %)


Example layout:

"Sheet.08"
Column B(date) Column K(empty - where VBA function should paste results into)
3/1/2008
3/1/2008
3/1/2008
3/1/2008
3/2/2008
3/2/2008
3/2/2008
3/3/2008
...

Sheet.Conv"
Column A(date) Column F(conversion %)
3/1/2008 .645
3/2/2008 .635
3/3/2008 .586
3/4/2008 .468

I need to compare column 08.B to column Conv.A to see if they are equal. Both are date columns, column 08.B repeats the same date multiple times while column Conv.A only has it once. If they don't equal, I need to go through until they match up again; then I copy the value in Conv.F and paste it into 08.K. So, for each row in Sheet "08", where the data in column B = the date in Conv.A, I need to paste the value from Conv.F, into the empty column 08.K. I need this to repeat until column 08.B is empty (there are no more dates to compare/retrieve data for).

Thanks in advance for any help.

embeins
08-28-2008, 11:06 AM
Thanks... see attachment for further reference.