I would like to know if there is a way to copy a range of data from excel sheet to word document and save the word document in this format "todays date.doc"
Any help would be appreciated in advance.
I would like to know if there is a way to copy a range of data from excel sheet to word document and save the word document in this format "todays date.doc"
Any help would be appreciated in advance.
Last edited by VBA Noob; 03-31-2007 at 10:11 AM.
Hello Walid66,
Here is the code you are looking for. Just be sure you have copied your range data before running the macro. Todays date is formatted as Mar-31-2007.
Sincerely,Please Login or Register to view this content.
Leith Ross
Thanks you so much for all your help.
can I add to the script the orientation of the word doc. for example change the page to horizontal setup?
Try this to set the orientation to landscape:
Note: I also changed the location where TD is set to the current date outside of the With clause. For some reason it didn't like it when I ran it with that in there. As soon as I pulled it out, it ran perfectly. (There's very little chance the date will change between the time you start the macro and the time it finishes, anyway.)Please Login or Register to view this content.
Last edited by Paul; 04-01-2007 at 12:45 AM.
Thanks it worked fine.
Great, glad it worked. Thanks Leith, for doing 99% of the work.
is it possible to specify the location where I want to save the file on this script?
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks