Macro to copy one worksheet to another

T

tarantula

I have a word macro that copies all the data from the active worksheet
and pastes it in a different excel workbook based on a template.I used
the following code:

sheets(1).Copy Before=Workbooks(WkbName).Sheets(1)


But it results in a new worksheet being inserted in the Workbook
WkbName..which i dont want.i want the data to be copied to the first
sheet of the workbook 'WkName'

Please Help!!
its urgent...
 
S

Simon Lloyd

Sheets(1).Copy copies the first sheet as a whole sheet, really you need
to copy the data and paste it to the first sheet.

tarantula;418841 said:
I have a word macro that copies all the data from the active worksheet
and pastes it in a different excel workbook based on a template.I used
the following code:

sheets(1).Copy Before=Workbooks(WkbName).Sheets(1)


But it results in a new worksheet being inserted in the Workbook
WkbName..which i dont want.i want the data to be copied to the first
sheet of the workbook 'WkName'

Please Help!!
its urgent...


--
Simon Lloyd

Regards,
Simon Lloyd
'The Code Cage' (http://www.thecodecage.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top