Macro to copy paste by date

Caitie

New Member
Joined
Jun 2, 2017
Messages
8
Hi, I am looking for some help in creating a macro that copies several series of cells from one sheet and pastes them into another but under the correct date. I know how to copy and paste the info with a macro but I am not sure how to do so in a way that puts the info under the correct date and does not just overwrite the info into the same series of cells.

There are 4 rows of data that will need to be copied and pasted under their respective date (dates are columns with 4 columns per date (one for each type of data)).

It looks like this:
7/26/2017 7/26/2017 7/26/2017 7/26/2017 7/27/2017 ..........
Heading 1 Heading 2 Heading 3 Heading 4 Heading 5
AAA
BBB
CCC
DDD
EEE

With the data being pasted under the appropriate heading for their respective date


Any assistance would be greatly appreciated!! Thanks :)
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.
26/07/201726/07/201726/07/201726/07/201727/07/201727/07/201727/07/201727/07/201727/07/201727/07/201727/07/201727/07/2017
14810
25911
3612
713
14
15
16
17
18
19
20
problem staatement
copy the data in the right hand table to the left
how is the data going to be different when you have pasted it ?
pick up the individual cells with something like
dim temp(10000)
for j=2 to 30
for k=11 to 14
sum=sum+1
temp(sum)=cells(j,k)
next k
next j
then find where to paste them
for z=1 to 10
if cells(1,z)=cells(1,11) then goto 100
next z
100 zz=z
then place them in the left hand table
for kk=zz to zz+3
tot=tot+1
for jj=2 to 30
cells(jj,kk)=temp(tot)
next kk
next jj

<colgroup><col><col><col><col><col><col><col><col><col span="2"><col><col><col><col><col></colgroup><tbody>
</tbody>
 
Upvote 0
26/07/2017
26/07/2017
26/07/2017
26/07/2017
27/07/2017
27/07/2017
27/07/2017
27/07/2017
27/07/2017
27/07/2017
27/07/2017
27/07/2017
1
4
8
10
2
5
9
11
3
6
12
7
13
14
15
16
17
18
19
20
problem staatement
copy the data in the right hand table to the left
how is the data going to be different when you have pasted it ?
pick up the individual cells with something like
dim temp(10000)
for j=2 to 30
for k=11 to 14
sum=sum+1
temp(sum)=cells(j,k)
next k
next j
then find where to paste them
for z=1 to 10
if cells(1,z)=cells(1,11) then goto 100
next z
100 zz=z
then place them in the left hand table
for kk=zz to zz+3
tot=tot+1
for jj=2 to 30
cells(jj,kk)=temp(tot)
next kk
next jj

<tbody>
</tbody>

Hi so sorry I realized I input the data slightly incorrect. Correct version is:
7/26/2017 7/26/2017 7/26/2017 7/26/2017 7/27/2017 ..........
Heading 1 Heading 2 Heading 3 Heading 4 Heading 5
AAA
BBB
CCC
DDD
EEE


This way the 4 different types of data are recorded for each row at each date
 
Upvote 0
Again I apologize. The thread changes my entry when I submit it. But the dates abd headings should be indented so that AAA, BBB, etc. is not underneath them
 
Upvote 0

Forum statistics

Threads
1,214,834
Messages
6,121,877
Members
449,056
Latest member
ruhulaminappu

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