VBA - date comparison and copy

MSalinas

New Member
Joined
Oct 1, 2014
Messages
4
This is my first post so please have patience with me. I have a work book with 4 tabs: Pivot Summary, Imported Data, Missed Job Data and Yesterday. I import data from an external source to the Imported Data tab. Then refresh data on a pivot table via the Pivot Summary sheet. On the Pivot table I double click on one of the results to open a 5th tab called Sheet1. These results vary from 1 to over 500. I created a macro to copy certain data from Sheet1 to Missed Job Data where I then break out 3 (D2, E2 & F2) date/time stamps (i.e. 10/23/2014 18:15) to individual date and time cells....cell H2/I2 will have the date and time respectively for D2, cell J2/K2 will have the date and time respectively for E2 and cell L2/M2 will have the date and time respectively for F2 and the list repeats to the end.

Here is my issue: I need to compare the date values from tab Missed Job Data column H to that in column L (H2 to L2, H3 to L3, H4 to L4....etc). If the dates in example H2/L2 match then I need to copy the data from the corresponding cells A2:F2 over to the Yesterday tab. If they don't then move to H3/L3, repeat the comparison. As the data gets copied over to the Yesterday tab, i would like for the data to be pasted one below the other with out skipping lines.

I know I am asking alot and my description may be confusing. I am not well versed in VBA, but I am self teaching as I go along. So any and ALL help will be reatly appreciated. Thanks in advance.
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop

Forum statistics

Threads
1,214,515
Messages
6,119,973
Members
448,933
Latest member
Bluedbw

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top