Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 03-16-2017, 11:03 PM
gmayor's Avatar
gmayor gmayor is offline Update content in table adds a new column Windows 10 Update content in table adds a new column Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

When working with cell ranges, be aware that the cell range includes the cell end character. You are more likely to get the results you are seeking if having set the range, you remove the end character from the range (whether copying or pasting) e.g.
Code:
Set rng_Paste = UserDoc.Tables(i).Cell(MyCell.RowIndex, 1).Range
rng_Paste.End = rng_Paste.End - 1
Note also that there is no need to copy and paste when working with ranges. You can simply write the formatted value of the source range to the target range e.g.
TargetRangeName.FormattedText = SourceRangeName.FormattedText.
Your last example code does not work with two documents and their corresponding tables.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
 

Tags
tables, vba macro

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop and Update Content Controls with value vss712 Word VBA 7 08-27-2015 08:56 PM
Update fields and Tables of Content with one macro brent chadwick Word VBA 7 03-11-2015 07:21 AM
Update content in table adds a new column Combine Different Word files into one file and update Table of Content tejaspareek Word VBA 4 11-04-2014 05:50 AM
Update content in table adds a new column How to align And center the content of the column in a table? Jamal NUMAN Word 1 05-02-2011 05:47 PM
Update content in table adds a new column SOS - cannot update table of content properly Lee Word 5 02-04-2011 12:59 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:01 AM.


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