+ Reply to Thread
Results 1 to 3 of 3

VBA code to copy a range from excel and pastes into a word document

  1. #1
    Registered User
    Join Date
    12-07-2016
    Location
    CO, USA
    MS-Off Ver
    2013
    Posts
    12

    VBA code to copy a range from excel and pastes into a word document

    Hello,

    I have been trying to get this write for the last two hours and I finally give up. I have a macro button that I would like to copy a range on my spreadsheet on a different sheet, open up a word document, and paste the range keeping the original formatting. I have been able to do everything except keep the original formatting (which works fine if I cut and past manually). Here is what I have so far:

    Sub COPY()
    Dim objWord As New Word.Application
    Sheets("Output").Select
    Range("C9:C50").COPY
    With objWord
    .Documents.Add
    .Selection.PasteSpecial xlPasteAllUsingSourceTheme
    .Visible = True
    End With
    End Sub

    The result is perfect except it uses Word's 1.5 spacing after paragraphs which I HATE. I use different computers throughout the day so I cannot simply just change the default setting for Word formatting, which I assume you can do).

    I know this is a simple problem but I am still learning.

    Thanks for the help!

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: VBA code to copy a range from excel and pastes into a word document

    Have you tried:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    12-07-2016
    Location
    CO, USA
    MS-Off Ver
    2013
    Posts
    12

    Re: VBA code to copy a range from excel and pastes into a word document

    Shoot, it still has those infernal 1.5 space after paragraph.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Copy range to word document
    By wjmj in forum Excel General
    Replies: 1
    Last Post: 12-18-2015, 05:18 PM
  2. Replies: 0
    Last Post: 09-04-2014, 03:32 AM
  3. VBA code. Copy Excel Sheet/Range with all formats but no grid lines to a new Word document
    By Richard Buttrey in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-17-2014, 08:06 PM
  4. Print off the word document using excel vba code
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-17-2013, 09:42 AM
  5. [SOLVED] Code to copy numerous sheet cell ranges to a word document on my desktop
    By matrixpom in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-21-2013, 07:48 PM
  6. VBA code to copy and create n number of word documents from excel range
    By skonduru in forum Word Programming / VBA / Macros
    Replies: 3
    Last Post: 01-17-2013, 03:20 PM
  7. Code to copy Excel data to a Word document
    By Zimbo in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 04-09-2009, 03:30 AM

Tags for this Thread

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