+ Reply to Thread
Results 1 to 3 of 3

Copy a range from excel to word with wrap text cells

  1. #1
    Registered User
    Join Date
    02-13-2015
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    34

    Copy a range from excel to word with wrap text cells

    Hi guys,

    I'm trying to copy a range of data (B4:C10 as an example) and paste it into word.

    Using the following code was working a treat:

    Please Login or Register  to view this content.
    However, one cell (C8) now has lots of data and requires 'wrap text' to see it all in excel. When I copy this across to word it throws the table out of whack (it shrinks column B and makes it look quite ugly).

    Is there a way to carry across the wrap text command so that the table in word maintains the same column sizes as it looks in excel?

    Hope that makes sense.

    Thanks in advance.

  2. #2
    Registered User
    Join Date
    12-17-2016
    Location
    South Wales
    MS-Off Ver
    Excel 2007, 2016
    Posts
    68

    Re: Copy a range from excel to word with wrap text cells

    Tables in word usually do wrap if they have to. But your macro states AutoFit, meaning that the column widths will be adjusted to best fit the length of data, minimising the need for wrapping.

    If you want to maintain the same column proportions in word as excel (won't necessarily be same width, as word needs to fit on a piece of paper, put this bit of code in your macro at the point where you are copying from excel:
    Please Login or Register  to view this content.
    Then amend your code extract as follows:
    Please Login or Register  to view this content.
    The first bit of code calculates the width of each column to the nearest whole percentage of the total width. The amendment in the second bit sets the column widths as these percentages, rather than as AutoFit. Text should then wrap if necessary.

  3. #3
    Registered User
    Join Date
    02-13-2015
    Location
    Brisbane, Australia
    MS-Off Ver
    2016
    Posts
    34

    Re: Copy a range from excel to word with wrap text cells

    Thanks for the reply Trevor_S. I'm off work for a few days now but when I get back I'll definitely check it out.
    Thanks again.

+ 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. [SOLVED] Macro to word wrap text only works on one cell but i need it for multiple cells
    By Triscia in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-29-2016, 12:03 PM
  2. Copy text in excel cells and paste as bullet into new word doc
    By olivierpbeland in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 11-03-2013, 05:09 PM
  3. [SOLVED] Why won't my text fully display with word-wrap and merged cells?
    By Will DeLoach in forum Excel General
    Replies: 6
    Last Post: 06-28-2006, 04:04 PM
  4. Replies: 1
    Last Post: 05-30-2006, 10:10 AM
  5. [SOLVED] Copy problem with cells which have Wrap Text property specified
    By didi in forum Excel General
    Replies: 1
    Last Post: 09-26-2005, 08:05 AM
  6. [SOLVED] Copy problem with cells which have Wrap Text property specified
    By didi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-26-2005, 07:05 AM

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