Microsoft Office Forums How to prevent a cell to disappear

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 08-08-2019, 11:07 PM
Dzib Dzib is offline How to prevent a cell to disappear Windows 10 How to prevent a cell to disappear Office 2019
Novice
How to prevent a cell to disappear
 
Join Date: Jul 2019
Posts: 19
Dzib is on a distinguished road
Default How to prevent a cell to disappear

Hi,




I have a macro that copy/paste a table from Excel to Word.

The table has 3 columns (last one can be empty) and a variable number of rows



Everything works fine except that when the the text in the 2nd column is longer than the size of the cell and the last cell of the row is empty, this cell dispappear and is replaced by the 2nd cell...


See attached picture:



How can I avoid this?


Thanks ;-)
Reply With Quote
  #2  
Old 08-13-2019, 02:31 PM
gmaxey gmaxey is offline How to prevent a cell to disappear Windows 10 How to prevent a cell to disappear Office 2016
Word MVP 2003-2009
 
Join Date: May 2010
Location: Marble, NC
Posts: 914
gmaxey will become famous soon enoughgmaxey will become famous soon enough
Default

Where is your macro?
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote
  #3  
Old 08-13-2019, 08:35 PM
eduzs eduzs is offline How to prevent a cell to disappear Windows 10 How to prevent a cell to disappear Office 2010 32bit
Competent Performer
 
Join Date: May 2017
Posts: 158
eduzs is on a distinguished road
Default

Select the column B of the used range, right click the selection and select Format Cells Menu, in Alingment enable "Wrap text" option, do this before copy to word.
To insert this procedure into your macro you can do something like this:
oRange.columns(2).wraptext=true
Backup before test.
__________________
Backup your original file before doing any modification, test in a throwaway copy of your file.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to prevent a cell to disappear Clear all cell colors within a range starting at cell A8 and change row of active cell to yellow FUGMAN Excel Programming 7 02-05-2017 08:37 AM
Prevent cell from expanding vertically. snowboarder2 Word Tables 1 08-24-2016 02:52 PM
How to prevent a cell to disappear If value of cell A Matches a value in a Range of cells (column) then add value of cell A to cell C rick10r Excel 1 07-05-2016 12:07 PM
Data Validation - Prevent blank cell based on a condition dawd Excel 2 08-12-2015 05:44 AM
Word tables: prevent word from highlighting whole cell when I highlight text skylark53 Word 2 08-04-2015 08:12 AM


All times are GMT -7. The time now is 11:58 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft