+ Reply to Thread
Results 1 to 8 of 8

copying from excel to word document

  1. #1
    Forum Contributor
    Join Date
    12-09-2006
    Posts
    229

    copying from excel to word document

    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.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    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.

    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Forum Contributor
    Join Date
    12-09-2006
    Posts
    229
    Thanks you so much for all your help.

  4. #4
    Forum Contributor
    Join Date
    12-09-2006
    Posts
    229

    Post

    can I add to the script the orientation of the word doc. for example change the page to horizontal setup?

  5. #5
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Try this to set the orientation to landscape:
    Please Login or Register  to view this content.
    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.)
    Last edited by Paul; 04-01-2007 at 12:45 AM.

  6. #6
    Forum Contributor
    Join Date
    12-09-2006
    Posts
    229
    Thanks it worked fine.

  7. #7
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Great, glad it worked. Thanks Leith, for doing 99% of the work.

  8. #8
    Forum Contributor
    Join Date
    12-09-2006
    Posts
    229
    is it possible to specify the location where I want to save the file on this script?

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1