View Single Post
 
Old 08-25-2015, 05:57 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

It appears your table uses formfields, in which case setting their 'calculate on exit' property will cause all of the calculations to update immediately you exit any of those fields. If you're not using formfields, selecting the table and pressing F9 will update all the calculations, or you could use content-controls in conjunction with a content-control on-exit macro.

As for getting cell addresses, the simplest way is to select the cell(s), then run the following macro, which outputs the range on Word's status bar:
Code:
Sub CellRange()
Dim StrAddr As String
' This macro displays the address of a table's selected cell range
' and the table's last cell address on Word's Status Bar
With Selection
  If .Information(wdWithInTable) = True Then
    StrAddr = "The selected "
    If .Cells.Count = 1 Then
      StrAddr = StrAddr & "cell address is: "
    Else
      StrAddr = StrAddr & "cells span: "
    End If
    StrAddr = StrAddr & ColAddr(.Cells(1).ColumnIndex) & .Cells(1).RowIndex
    If .Cells.Count > 1 Then
      StrAddr = StrAddr & ":" & ColAddr(.Characters.Last.Cells(1).ColumnIndex) & _
        .Characters.Last.Cells(1).RowIndex
    End If
    With .Tables(1).Range
    StrAddr = StrAddr & ". The table's last cell is at: " & _
      ColAddr(.Cells(.Cells.Count).ColumnIndex) & .Cells(.Cells.Count).RowIndex
    End With
      StatusBar = StrAddr
    Else
      StatusBar = "The selection is not in a table!"
  End If
End With
End Sub
Function ColAddr(i As Long) As String
If i > 26 Then
  ColAddr = Chr(64 + Int(i / 26)) & Chr(64 + (i Mod 26))
Else
  ColAddr = Chr(64 + i)
End If
End Function
For macro installation & usage instructions, see: http://www.gmayor.com/installing_macro.htm
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote