Hi Team,

i have an excel workbook (rawdata)where in have consolidated data in a sheet named "Sheet1", this sheet has data which need to be copied to a different excel workbook (kind of template). now the challenge is to copy the data on horizontally from the sheet1 and paste it into the template vertically based on the sheetname,country & datewise . On the Sheet1 i have columns like sheetname,date, and then few other columns which has the data which need to be copied, now the Sheetname column has the names of the sheets which is in the template workbook where the data need to be copied, before copy the data below give condition need to be checked.

1. check the sheetnames in sheetname column (which is in the raw data workbook in sheet1)
2. Then check the date under the date column.
3. based on above conditions the data need to be copied from the other column (sheet1 have lot many column with different names which has data in it which need to be copied, the same names are in the template workbook aligned vertically)

4.while pasting the data into the Template worksheet the below conditions need to be considered

a. name of the sheet should match with the sheetname which is the sheet1 (in the raw data workbook)
b. there are columns in the template workbook which has been aligned by dates .
c. There is column named as Country in the template under there are different Country names (the same Countries are listed in the rawdata workbook in sheet1 as different columns ).

so in-short the data need to be copied from sheet1 (rawdataworkbook) and need to move to the matching sheetname, under different date columns based on the Country.

i have attached both the work file images (datasheet & template).
Rawdatascreenshot.png
templatescreenshto.png

I need to have vba code to process this request .Please someone help me with this .