![]() |
|
|
|
#1
|
||||
|
||||
|
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
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
| Tags |
| autoupdate, localize a cell name |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Auto update date
|
mavisyew | Word | 2 | 07-15-2015 08:44 AM |
I want to use formula to auto update cells with information
|
Steve81uk | Excel | 15 | 01-09-2015 12:58 PM |
| Change formula cell range based on cell value | Scoth | Excel | 4 | 10-25-2012 07:51 AM |
| Project Auto-Update | hB-sys | Project | 0 | 04-15-2010 06:46 AM |
| Auto-populate an MS Word table cell with text from a diff cell? | dreamrthts | Word Tables | 0 | 03-20-2009 01:49 PM |