Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 12-31-2016, 08:46 PM
macropod's Avatar
macropod macropod is offline How to find Word links (fields) to blank Excel cells? Windows 7 64bit How to find Word links (fields) to blank Excel cells? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,516
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

You could use a macro like the following to delete all LINK fields whose result is effectively nothing:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim i As Long
With ActiveDocument
  For i = Fields.Count To 1 Step -1
    With .Fields(i)
      If .Type = wdFieldLink Then
        If Trim(.Result) = "" Then .Delete
      End If
    End With
  Next
End With
Application.ScreenUpdating = True
End Sub
For PC macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
For Mac macro installation & usage instructions, see: http://word.mvps.org/Mac/InstallMacro.html
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to find Word links (fields) to blank Excel cells? Excel-find cells that contain all upper cas Mamadukes2007 Excel 2 02-06-2016 02:17 AM
Find and list Blank pages in Word document. ndandge Word VBA 4 11-29-2015 09:15 PM
How to find Word links (fields) to blank Excel cells? locking word table cells while auto-updating fields fingermouse Word 6 01-14-2015 06:22 AM
How to find Word links (fields) to blank Excel cells? How to make Excel stop treating blank cells as zero Chuck_Ds Excel 10 01-13-2015 08:33 AM
How to find Word links (fields) to blank Excel cells? Excel VBA - Mandatory cells cannot stay blank? hussnainh8 Excel 9 12-28-2014 09:40 AM

Other Forums: Access Forums

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