Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 11-08-2018, 01:02 PM
trvlnmny trvlnmny is offline Updating Cross refs Windows 10 Updating Cross refs Office 2016
Novice
Updating Cross refs
 
Join Date: Nov 2018
Location: NJ
Posts: 1
trvlnmny is on a distinguished road
Red face Updating Cross refs

I am using msw 16. I have a file that contains a table. The first column of the table is a numbered list. There are other columns in the table that show cross refs to the first column in several other rows. I have now sorted the table on columns other than the first. This redoes the first column starting with 1 again which is fine. The cross refs still show the original numbers but they are highlighted so they can be updated.
As this a fairly large table updating the individual cross refs is very time consuming.

Is there a way to globally update these fields?

Thanks for any and all help.
Reply With Quote
  #2  
Old 11-08-2018, 01:27 PM
macropod's Avatar
macropod macropod is offline Updating Cross refs Windows 7 64bit Updating Cross refs Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
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

Does selecting the whole table and pressing F9 achieve what you want? If not, we'll need a better explanation of what you've referenced, how the referencing was done and how they should be updated.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #3  
Old 11-09-2018, 07:26 AM
Charles Kenyon Charles Kenyon is offline Updating Cross refs Windows 10 Updating Cross refs Office 2016
Moderator
 
Join Date: Mar 2012
Location: Sun Prairie, Wisconsin
Posts: 9,136
Charles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant futureCharles Kenyon has a brilliant future
Default

Otherwise, the following macro will update all cross-references in a document, but may be overkill.

Code:
Sub UpdateAllRef()
'   Update all Ref fields in a document, even if in headers/footers or textboxes
    ' https://gregmaxey.com/word_tip_pages/word_fields.html
    ' November 6, 2018 Charles Kenyon
    Dim rngStory As Word.range
    Dim lngValidate As Long ' do not know purpose of this - CK
    Dim oShp As Shape
'    Dim oTOC As TableOfContents, oToa As TableOfAuthorities, oTof As TableOfFigures
    Dim oStory As range
    Dim oField As Field

    lngValidate = ActiveDocument.Sections(1).Headers(1).range.StoryType ' do not know purpose of this
    For Each rngStory In ActiveDocument.StoryRanges
      'Iterate through all linked stories
        For Each oField In oStory.Fields
            If oField.Type = wdFieldRef Then oField.Update
        Next oField
      Do
        On Error Resume Next
        For Each oField In rngStory.Fields
            If oField.Type = wdFieldRef Then oField.Update
        Next oField
            
'        rngStory.Fields.Update
        Select Case rngStory.StoryType
          Case 6, 7, 8, 9, 10, 11
            If rngStory.ShapeRange.Count > 0 Then
              For Each oShp In rngStory.ShapeRange
                If oShp.TextFrame.HasText Then
                    For Each oField In oShp.TextFrame.Fields
                        If oField.Type = wdFieldRef Then oField.Update
                    Next oField
'                   oShp.TextFrame.TextRange.Fields.Update
                End If
              Next
            End If
          Case Else
            'Do Nothing
        End Select
        On Error GoTo 0
        'Get next linked story (if any)
        Set rngStory = rngStory.NextStoryRange
      Loop Until rngStory Is Nothing
'      'Special Cases
'      For Each oTOC In ActiveDocument.TablesOfContents
'        oTOC.Update
'      Next oTOC
'      For Each oToa In ActiveDocument.TablesOfAuthorities
'        oToa.Update
'      Next
'      For Each oTof In ActiveDocument.TablesOfFigures
'        oTof.Update
'      Next
    Next
    '
    Set oStory = Nothing
    Set oField = Nothing
    Set rngStory = Nothing
    Set oShp = Nothing
'    Set oTOC = Nothing
'    Set oToa = Nothing
'    Set oTof = Nothing
End Sub
Reply With Quote
  #4  
Old 11-09-2018, 05:13 PM
Stefan Blom's Avatar
Stefan Blom Stefan Blom is offline Updating Cross refs Windows 10 Updating Cross refs Office 2016
Moderator
 
Join Date: Aug 2011
Posts: 3,906
Stefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to allStefan Blom is a name known to all
Default

You can trigger an update of cross-reference fields by switching to print preview (File | Print) and then return to Print Layout view (for example by pressing ESC).
__________________
Stefan Blom
Microsoft Word MVP

Microsoft 365 apps for business
Windows 11 Professional
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Updating Cross refs cross-refs: navigate from target back to source eNGiNe Word 1 03-03-2015 12:51 PM
Updating Cross refs Help with set up of automatically updating cross reference. lukebrown Word VBA 5 09-11-2013 09:38 AM
Updating Cross refs Cross references not updating correctly CLWriter Word 4 04-03-2012 07:23 AM
Updating Cross refs cross-referencing - lock/unlock updating minszki Word 1 03-11-2012 11:28 AM
Updating Cross refs Mass Update of Cross-Refs MS2010 judicial85 Word 1 03-08-2011 10:33 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 12:23 AM.


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