View Single Post
 
Old 02-10-2017, 05:21 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,387
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 Hdata View Post
Yes, I have word tables previously setup with updateable cell formulas. I also have a list of cell references which I would like to GoTo in order to update these formulas.
You don't need to 'Goto' or 'Select' anything for this. All you need is something like:
Code:
Sub Demo()
Application.ScreenUpdating = False
Dim ArrTbls, ArrRows, ArrCols, i As Long
ArrTbls = Array(1, 1, 3, 3, 4, 5)
ArrRows = Array(6, 8, 6, 8, 6, 6)
ArrCols = Array(4, 4, 5, 7, 2, 2)
With ActiveDocument
  For i = 0 To UBound(ArrTbls)
    .Tables(ArrTbls(i)).Cell(ArrRows(i), ArrCols(i)).Range.Fields.Update
  Next
End With
Application.ScreenUpdating = True
End Sub
With this code, you use three arrays, one each for the tables, rows & columns to be updated. Each array contains its respective table index, row index and cell index for the cells you want to update. In the above demo, the first set of array entries points to table 1, row 6 column 4, the second set of array entries points to table 1, row 8 column 4, and so on.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote