Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #6  
Old 11-21-2015, 06:57 AM
gmayor's Avatar
gmayor gmayor is offline Merging data from Two word documents based on number search Windows 7 64bit Merging data from Two word documents based on number search Office 2010 32bit
Expert
 
Join Date: Aug 2014
Posts: 4,142
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

If I understand your request correctly, you need to add a condition to modify only unfilled cells e.g.

Code:
Set oCell = oDoc.Tables(1).Rows(iRow).Cells(5).Range
    oCell.End = oCell.End - 1
    If Len(oCell) = 0 Then 'Add This line
        oCell.FormattedText = oRng.FormattedText        'use this line to keep the formatting
        'oCell.Text = oRng.Text 'use this line if the formatting is not required
        Exit Do
    End If 'And this one
__________________
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
data merge, ms word 2010, vba code



Similar Threads
Thread Thread Starter Forum Replies Last Post
search on multiple word documents Guy Roth Word 7 03-06-2017 01:31 PM
Merging data from Two word documents based on number search Merging Word documents and keeping the formatting exactly as it appears in the original document NovaScotia Word 4 01-21-2015 11:44 PM
Merging data from Two word documents based on number search Advanced search in Word documents beirput Word 3 11-10-2014 02:53 AM
Merging data from Two word documents based on number search Merging bibliographies with word documents using separate master lists Cimballi Word 3 07-01-2014 03:45 AM
How to preserve or Retain bookmarks during Merging of word documents ramsgarla Word 2 09-18-2012 08:59 AM

Other Forums: Access Forums

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