copy all sheets to a new workbook

F

futbol

hello gurus,
i'm looking for vba code to copy only values and formats to a new
workbook preserving the name on each tab.
thanks in advance
 
J

JP

There's some code on this page that can assist you.

http://www.rondebruin.nl/values.htm

You can use the code in "Change all the cells in all worksheets to
values", save the file with a new name, and close the original
workbook without saving. This should do what you want.


HTH,
JP
 
F

futbol

There's some code on this page that can assist you.

http://www.rondebruin.nl/values.htm

You can use the code in "Change all the cells in all worksheets to
values", save the file with a new name, and close the original
workbook without saving. This should do what you want.

HTH,
JP



- Show quoted text -

it does work, obviously including code to finish the job saving the
workbook with values or creating another one would be nice
 
J

JP

At the beginning of the macro, put

Dim AWS as worksheet
Set AWS = Activesheet

At the end, put

Activeworkbook.SaveAs "your new values-only workbook filename here"
AWS.close false

(note untested code)
This will set a reference to the original workbook, save the new file
to a new name, then close the original workbook so you can reuse.

HTH,
JP
 

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