Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-26-2012, 07:01 PM
macropod's Avatar
macropod macropod is offline Update Word table based on another table input Windows 7 64bit Update Word table based on another table input Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default


Quote:
Originally Posted by mpdsal View Post
Unless I am missing something, when you select a cell within a table and use the copy/paste function it only pastes the related text not the background format.
My Bad - I was thinking that one of the PasteAndFormat options preserved shading info. Nevertheless, you could use something like:
Code:
Sub Demo()
Dim lBkClr As Long, lFrClr As Long, i As Long
With ActiveDocument.Tables(1).Range
  For i = 1 To .Cells.Count
    With .Cells(i)
      .Range.Copy
      lBkClr = .Shading.BackgroundPatternColor
      lFrClr = .Shading.ForegroundPatternColor
    End With
    With ActiveDocument.Tables(2).Range.Cells(i)
      .Range.Paste
      .Shading.BackgroundPatternColor = lBkClr
      .Shading.ForegroundPatternColor = lFrClr
    End With
  Next
End With
Quote:
Also if you use bookmarks it only references the text of the cell none of the shading.
Not so if you're replicating the entire table. Furthermore, if you bookmark an entire cell, the entire cell will be replicated, including its borders & shading in the cross-reference.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 10-29-2012, 07:40 AM
mpdsal mpdsal is offline Update Word table based on another table input Windows XP Update Word table based on another table input Office 2007
Novice
Update Word table based on another table input
 
Join Date: Nov 2011
Posts: 19
mpdsal is on a distinguished road
Default

Paul,

I'll give your code a try.

I must only have the text Bookmarked in that case. I'll play around some more with utilizing Bookmarks to capture all settings for a cell.

Thanks again.

Mark
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Linking excel table to powerpoint for easy update atwood121 PowerPoint 0 05-11-2012 07:09 AM
Update Word table based on another table input How do I dynamically update data in a Word Document from a database table RSchmidt Word 1 07-14-2011 04:27 PM
Table update in running presentation rumdrum PowerPoint 0 02-10-2011 01:28 PM
Update Word table based on another table input SOS - cannot update table of content properly Lee Word 5 02-04-2011 12:59 PM
Easy Update "Table of Contents" feature in Microsoft Word 2007 VS. Word 2010 Xarzu Word 0 09-22-2010 06:54 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:02 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