Hi All,
I have a daily task where from pivot i have to select yesterday's date and copy the data into another sheet.. is there any way by which i can use macro for the same. What i Do daily is
1- from pivot i select yesterdays date from "create date" column and then copy the data in another sheet.
i am trying to achieve here is in output cell of "A1" i will have ysterday's date , macro should pick up that date , and run the same in pivot of "create date", (which is column J), Then 2nd condition is he should filter "pitched,Mandate" from "stage" column which is column C, if he found any data then, it should be copied to another sheet. if no data found macro should copy only pivot headers.
below is the test data.. I am sorry that i can not attach file here..so just copying the pivot Data here.. thanks all in advance for your help. appreciate your input for the same.
[TABLE="width: 1099"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mandate Date[/TD]
[TD](All)[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Lost Date[/TD]
[TD](All)[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"]Sum of Sub ID Rev[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sub ID[/TD]
[TD]Final Family Name[/TD]
[TD]Stage[/TD]
[TD]Country[/TD]
[TD]Member[/TD]
[TD]AM[/TD]
[TD]Team[/TD]
[TD]E/G[/TD]
[TD]Prod Level 2[/TD]
[TD]Create Date[/TD]
[TD]Close Date[/TD]
[TD]Total[/TD]
[/TR]
[TR]
[TD]11223353[/TD]
[TD]sodexo-1[/TD]
[TD]MANDATE[/TD]
[TD]nepal[/TD]
[TD]test10[/TD]
[TD](blank)[/TD]
[TD]mid corp[/TD]
[TD]E[/TD]
[TD]test10[/TD]
[TD="align: right"]01/04/2019[/TD]
[TD="align: right"]02/04/2019[/TD]
[TD="align: right"]98687[/TD]
[/TR]
[TR]
[TD]11223352[/TD]
[TD]dell-1[/TD]
[TD]COMPLETED[/TD]
[TD]ladakh[/TD]
[TD]test9[/TD]
[TD](blank)[/TD]
[TD]small corp[/TD]
[TD]G[/TD]
[TD]test9[/TD]
[TD="align: right"]02/04/2019[/TD]
[TD="align: right"]02/04/2019[/TD]
[TD="align: right"]87545[/TD]
[/TR]
[TR]
[TD]11223346[/TD]
[TD]facebook-1[/TD]
[TD]DEAD[/TD]
[TD]goa[/TD]
[TD]test3[/TD]
[TD](blank)[/TD]
[TD]Large Corporate[/TD]
[TD]G[/TD]
[TD]test3[/TD]
[TD="align: right"]02/04/2019[/TD]
[TD="align: right"]01/04/2019[/TD]
[TD="align: right"]69874[/TD]
[/TR]
[TR]
[TD]11223345[/TD]
[TD]Asian Paints-1[/TD]
[TD]MANDATE[/TD]
[TD]Mumbai[/TD]
[TD]test2[/TD]
[TD](blank)[/TD]
[TD]Large Corporate[/TD]
[TD]G[/TD]
[TD]test2[/TD]
[TD="align: right"]01/04/2019[/TD]
[TD="align: right"]15/04/2019[/TD]
[TD="align: right"]58687[/TD]
[/TR]
[TR]
[TD]11223350[/TD]
[TD]calender-1[/TD]
[TD]DONE AWAY[/TD]
[TD]hyderabad[/TD]
[TD]test7[/TD]
[TD](blank)[/TD]
[TD]small corp[/TD]
[TD]G[/TD]
[TD]test7[/TD]
[TD="align: right"]01/04/2019[/TD]
[TD="align: right"]01/04/2019[/TD]
[TD="align: right"]56987[/TD]
[/TR]
[TR]
[TD]11223349[/TD]
[TD]end-1[/TD]
[TD]COMPLETED[/TD]
[TD]chennai[/TD]
[TD]test6[/TD]
[TD](blank)[/TD]
[TD]mid corp[/TD]
[TD]E[/TD]
[TD]test6[/TD]
[TD="align: right"]02/04/2019[/TD]
[TD="align: right"]15/04/2019[/TD]
[TD="align: right"]52689[/TD]
[/TR]
[TR]
[TD]11223348[/TD]
[TD]stat-1[/TD]
[TD]PROSPECTING[/TD]
[TD]Bangalore[/TD]
[TD]test5[/TD]
[TD](blank)[/TD]
[TD]small corp[/TD]
[TD]G[/TD]
[TD]test5[/TD]
[TD="align: right"]01/04/2019[/TD]
[TD="align: right"]03/04/2019[/TD]
[TD="align: right"]42698[/TD]
[/TR]
[TR]
[TD]11223347[/TD]
[TD]gmail-1[/TD]
[TD]DONE AWAY[/TD]
[TD]Delhi[/TD]
[TD]test4[/TD]
[TD](blank)[/TD]
[TD]Large Corporate[/TD]
[TD]E[/TD]
[TD]test4[/TD]
[TD="align: right"]02/04/2019[/TD]
[TD="align: right"]02/04/2019[/TD]
[TD="align: right"]42159[/TD]
[/TR]
[TR]
[TD]11223344[/TD]
[TD]Nerolac-1[/TD]
[TD]PITCHED[/TD]
[TD]India[/TD]
[TD]test1[/TD]
[TD](blank)[/TD]
[TD]Large Corporate[/TD]
[TD]G[/TD]
[TD]test1[/TD]
[TD="align: right"]02/04/2019[/TD]
[TD="align: right"]03/04/2019[/TD]
[TD="align: right"]15487[/TD]
[/TR]
[TR]
[TD]11223351[/TD]
[TD]avaya-1[/TD]
[TD]PROSPECTING[/TD]
[TD]kolkata[/TD]
[TD]test8[/TD]
[TD](blank)[/TD]
[TD]mid corp[/TD]
[TD]E[/TD]
[TD]test8[/TD]
[TD="align: right"]01/04/2019[/TD]
[TD="align: right"]02/04/2019[/TD]
[TD="align: right"]2444[/TD]
[/TR]
[TR]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Grand Total[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]527257[/TD]
[/TR]
</tbody>[/TABLE]
I have a daily task where from pivot i have to select yesterday's date and copy the data into another sheet.. is there any way by which i can use macro for the same. What i Do daily is
1- from pivot i select yesterdays date from "create date" column and then copy the data in another sheet.
i am trying to achieve here is in output cell of "A1" i will have ysterday's date , macro should pick up that date , and run the same in pivot of "create date", (which is column J), Then 2nd condition is he should filter "pitched,Mandate" from "stage" column which is column C, if he found any data then, it should be copied to another sheet. if no data found macro should copy only pivot headers.
below is the test data.. I am sorry that i can not attach file here..so just copying the pivot Data here.. thanks all in advance for your help. appreciate your input for the same.
[TABLE="width: 1099"]
<tbody>[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Mandate Date[/TD]
[TD](All)[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Lost Date[/TD]
[TD](All)[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD="colspan: 2"]Sum of Sub ID Rev[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Sub ID[/TD]
[TD]Final Family Name[/TD]
[TD]Stage[/TD]
[TD]Country[/TD]
[TD]Member[/TD]
[TD]AM[/TD]
[TD]Team[/TD]
[TD]E/G[/TD]
[TD]Prod Level 2[/TD]
[TD]Create Date[/TD]
[TD]Close Date[/TD]
[TD]Total[/TD]
[/TR]
[TR]
[TD]11223353[/TD]
[TD]sodexo-1[/TD]
[TD]MANDATE[/TD]
[TD]nepal[/TD]
[TD]test10[/TD]
[TD](blank)[/TD]
[TD]mid corp[/TD]
[TD]E[/TD]
[TD]test10[/TD]
[TD="align: right"]01/04/2019[/TD]
[TD="align: right"]02/04/2019[/TD]
[TD="align: right"]98687[/TD]
[/TR]
[TR]
[TD]11223352[/TD]
[TD]dell-1[/TD]
[TD]COMPLETED[/TD]
[TD]ladakh[/TD]
[TD]test9[/TD]
[TD](blank)[/TD]
[TD]small corp[/TD]
[TD]G[/TD]
[TD]test9[/TD]
[TD="align: right"]02/04/2019[/TD]
[TD="align: right"]02/04/2019[/TD]
[TD="align: right"]87545[/TD]
[/TR]
[TR]
[TD]11223346[/TD]
[TD]facebook-1[/TD]
[TD]DEAD[/TD]
[TD]goa[/TD]
[TD]test3[/TD]
[TD](blank)[/TD]
[TD]Large Corporate[/TD]
[TD]G[/TD]
[TD]test3[/TD]
[TD="align: right"]02/04/2019[/TD]
[TD="align: right"]01/04/2019[/TD]
[TD="align: right"]69874[/TD]
[/TR]
[TR]
[TD]11223345[/TD]
[TD]Asian Paints-1[/TD]
[TD]MANDATE[/TD]
[TD]Mumbai[/TD]
[TD]test2[/TD]
[TD](blank)[/TD]
[TD]Large Corporate[/TD]
[TD]G[/TD]
[TD]test2[/TD]
[TD="align: right"]01/04/2019[/TD]
[TD="align: right"]15/04/2019[/TD]
[TD="align: right"]58687[/TD]
[/TR]
[TR]
[TD]11223350[/TD]
[TD]calender-1[/TD]
[TD]DONE AWAY[/TD]
[TD]hyderabad[/TD]
[TD]test7[/TD]
[TD](blank)[/TD]
[TD]small corp[/TD]
[TD]G[/TD]
[TD]test7[/TD]
[TD="align: right"]01/04/2019[/TD]
[TD="align: right"]01/04/2019[/TD]
[TD="align: right"]56987[/TD]
[/TR]
[TR]
[TD]11223349[/TD]
[TD]end-1[/TD]
[TD]COMPLETED[/TD]
[TD]chennai[/TD]
[TD]test6[/TD]
[TD](blank)[/TD]
[TD]mid corp[/TD]
[TD]E[/TD]
[TD]test6[/TD]
[TD="align: right"]02/04/2019[/TD]
[TD="align: right"]15/04/2019[/TD]
[TD="align: right"]52689[/TD]
[/TR]
[TR]
[TD]11223348[/TD]
[TD]stat-1[/TD]
[TD]PROSPECTING[/TD]
[TD]Bangalore[/TD]
[TD]test5[/TD]
[TD](blank)[/TD]
[TD]small corp[/TD]
[TD]G[/TD]
[TD]test5[/TD]
[TD="align: right"]01/04/2019[/TD]
[TD="align: right"]03/04/2019[/TD]
[TD="align: right"]42698[/TD]
[/TR]
[TR]
[TD]11223347[/TD]
[TD]gmail-1[/TD]
[TD]DONE AWAY[/TD]
[TD]Delhi[/TD]
[TD]test4[/TD]
[TD](blank)[/TD]
[TD]Large Corporate[/TD]
[TD]E[/TD]
[TD]test4[/TD]
[TD="align: right"]02/04/2019[/TD]
[TD="align: right"]02/04/2019[/TD]
[TD="align: right"]42159[/TD]
[/TR]
[TR]
[TD]11223344[/TD]
[TD]Nerolac-1[/TD]
[TD]PITCHED[/TD]
[TD]India[/TD]
[TD]test1[/TD]
[TD](blank)[/TD]
[TD]Large Corporate[/TD]
[TD]G[/TD]
[TD]test1[/TD]
[TD="align: right"]02/04/2019[/TD]
[TD="align: right"]03/04/2019[/TD]
[TD="align: right"]15487[/TD]
[/TR]
[TR]
[TD]11223351[/TD]
[TD]avaya-1[/TD]
[TD]PROSPECTING[/TD]
[TD]kolkata[/TD]
[TD]test8[/TD]
[TD](blank)[/TD]
[TD]mid corp[/TD]
[TD]E[/TD]
[TD]test8[/TD]
[TD="align: right"]01/04/2019[/TD]
[TD="align: right"]02/04/2019[/TD]
[TD="align: right"]2444[/TD]
[/TR]
[TR]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD](blank)[/TD]
[TD][/TD]
[/TR]
[TR]
[TD]Grand Total[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD="align: right"]527257[/TD]
[/TR]
</tbody>[/TABLE]
Last edited: