Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 12-31-2016, 01:06 PM
Fabulist Fabulist is offline How to find Word links (fields) to blank Excel cells? Windows 10 How to find Word links (fields) to blank Excel cells? Office 2016
Advanced Beginner
How to find Word links (fields) to blank Excel cells?
 
Join Date: Sep 2015
Posts: 33
Fabulist is on a distinguished road
Default How to find Word links (fields) to blank Excel cells?

Hello,



I have a Word file with multiple linked items, mostly cells with words or numbers, from an Excel file, and I noticed that old links leading to now empty cells still exist. This happened because the Excel file evolved over time and the Word file got its fields updated, hence I was not able to see the previous link to delete it, as there was nothing visible where the linked item used to be.

Field Shading does not shade these links to the blank Excel cells, and they are near impossible to trace since they seem to take no space, but are visible through Alt + F9 -
this is how I caught a couple, since I saw a link in a place where there should be none. However, due to the fact there are areas where there are multiple links stacked together, I cannot identify which should be there and which should not.

Is there a way to track these links to empty cells and eliminate them? For example, highlight links to empty cells?

Thank you in advance.
Reply With Quote
  #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: 21,963
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
  #3  
Old 01-01-2017, 03:35 AM
Fabulist Fabulist is offline How to find Word links (fields) to blank Excel cells? Windows 10 How to find Word links (fields) to blank Excel cells? Office 2016
Advanced Beginner
How to find Word links (fields) to blank Excel cells?
 
Join Date: Sep 2015
Posts: 33
Fabulist is on a distinguished road
Default

This seems to work, thank you for your time and happy new year!
Reply With Quote
Reply



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 08:07 PM.


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