Hi all,
Can someone please help me with a code. I have a workbook with sheet1 which contains data that I want to copy that data to different workbooks (Month tab) based on the values in column a.
The data in Sheet1 is sorted by column a and the workbooks which the data has to be copied to are named based on column a values.
For example the table below will be the values in sheet1[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]YEAR[/TD]
[TD]Month[/TD]
[TD]QTY[/TD]
[TD]Code[/TD]
[TD]CONFRM[/TD]
[/TR]
[TR]
[TD]IND[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]12[/TD]
[TD]2345[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]IND[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]45[/TD]
[TD]2345[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]IRE[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]646[/TD]
[TD]3345[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]IRE[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]35[/TD]
[TD]3345[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]SGP[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]35[/TD]
[TD]4588[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]45[/TD]
[TD]1101[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]452[/TD]
[TD]1102[/TD]
[TD]Y[/TD]
[/TR]
</tbody>[/TABLE]
The destination workbooks are saved in a different folder (named Completed) on the desktop. In that folder there are excel files with with name that begin with names like in the Name column above ie IND Monthly Data, IRE Monthly Data, USA Monthly Data etc. There are a lot more than whats shown above so I would like to make the code dynamic.
What I would like to do is to have the code to loop through the data in sheet1 and open files saved in the Completed folder and save the data.
So for example the code will copy the information in the sheet1 to 4 different workbooks and save each and close. The data will be pasted into cell B2 because the destination file already has headers.
Example: workbook "IND Monthly Data" and Month tab will have the following
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]YEAR[/TD]
[TD]Month[/TD]
[TD]QTY[/TD]
[TD]Code[/TD]
[TD]CONFRM[/TD]
[/TR]
[TR]
[TD]IND[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]12[/TD]
[TD]2345[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]IND[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]45[/TD]
[TD]2345[/TD]
[TD]Y[/TD]
[/TR]
</tbody>[/TABLE]
Example: workbook "IRE Monthly Data" and Month tab will have the following
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]YEAR[/TD]
[TD]Month[/TD]
[TD]QTY[/TD]
[TD]Code[/TD]
[TD]CONFRM[/TD]
[/TR]
[TR]
[TD]IRE[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]646[/TD]
[TD]3345[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]IRE[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]35[/TD]
[TD]3345[/TD]
[TD]Y[/TD]
[/TR]
</tbody>[/TABLE]
Thank you so much in advance.
Mjoza
Can someone please help me with a code. I have a workbook with sheet1 which contains data that I want to copy that data to different workbooks (Month tab) based on the values in column a.
The data in Sheet1 is sorted by column a and the workbooks which the data has to be copied to are named based on column a values.
For example the table below will be the values in sheet1[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]YEAR[/TD]
[TD]Month[/TD]
[TD]QTY[/TD]
[TD]Code[/TD]
[TD]CONFRM[/TD]
[/TR]
[TR]
[TD]IND[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]12[/TD]
[TD]2345[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]IND[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]45[/TD]
[TD]2345[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]IRE[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]646[/TD]
[TD]3345[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]IRE[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]35[/TD]
[TD]3345[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]SGP[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]35[/TD]
[TD]4588[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]45[/TD]
[TD]1101[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]USA[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]452[/TD]
[TD]1102[/TD]
[TD]Y[/TD]
[/TR]
</tbody>[/TABLE]
The destination workbooks are saved in a different folder (named Completed) on the desktop. In that folder there are excel files with with name that begin with names like in the Name column above ie IND Monthly Data, IRE Monthly Data, USA Monthly Data etc. There are a lot more than whats shown above so I would like to make the code dynamic.
What I would like to do is to have the code to loop through the data in sheet1 and open files saved in the Completed folder and save the data.
So for example the code will copy the information in the sheet1 to 4 different workbooks and save each and close. The data will be pasted into cell B2 because the destination file already has headers.
Example: workbook "IND Monthly Data" and Month tab will have the following
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]YEAR[/TD]
[TD]Month[/TD]
[TD]QTY[/TD]
[TD]Code[/TD]
[TD]CONFRM[/TD]
[/TR]
[TR]
[TD]IND[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]12[/TD]
[TD]2345[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]IND[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]45[/TD]
[TD]2345[/TD]
[TD]Y[/TD]
[/TR]
</tbody>[/TABLE]
Example: workbook "IRE Monthly Data" and Month tab will have the following
[TABLE="width: 500"]
<tbody>[TR]
[TD]Name[/TD]
[TD]YEAR[/TD]
[TD]Month[/TD]
[TD]QTY[/TD]
[TD]Code[/TD]
[TD]CONFRM[/TD]
[/TR]
[TR]
[TD]IRE[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]646[/TD]
[TD]3345[/TD]
[TD]Y[/TD]
[/TR]
[TR]
[TD]IRE[/TD]
[TD]2015[/TD]
[TD]October[/TD]
[TD]35[/TD]
[TD]3345[/TD]
[TD]Y[/TD]
[/TR]
</tbody>[/TABLE]
Thank you so much in advance.
Mjoza