locked
Figure out what cell i am in in word 2010 RRS feed

  • Question

  • I am using word 2010 and have a simple Table setup.  I would like to do some simple calculation (first row times 3rd row, sum up all of the 3rd column).  in word 2010 i see the formula box but i cant figure out how to determine what cell i am in.  does anyone know how to determine what cell i am in to use this formula box?

    Thank you,

    Monday, December 24, 2012 6:00 PM

Answers

  • You could copy the following macro into a module in your default template Normal.dotm:

    Sub GetCellAddress()
        Dim lngRow As Long
        Dim lngCol As Long
        If Selection.Information(wdWithInTable) Then
            lngRow = Selection.Cells(1).RowIndex
            lngCol = Selection.Cells(1).ColumnIndex
            MsgBox "Address of (first) cell in selection is " & _
                Chr(64 + lngCol) & lngRow, vbInformation
        Else
            MsgBox "Selection not within table.", vbInformation
        End If
    End Sub

    If you assign it to a Quick Access Toolbar button and/or a custom keyboard shortcut, you can quickly get information about the cell containing the insertion point.

    Regards, Hans Vogelaar

    • Marked as answer by iworkhere Tuesday, December 25, 2012 3:10 PM
    Monday, December 24, 2012 8:12 PM

All replies

  • Word uses the same notation as Excel:

    The cells in the first row are, from left to right, A1, B1, C1...

    Those in the second row are A2, B2, C2, ...

    etc.


    Regards, Hans Vogelaar

    Monday, December 24, 2012 6:20 PM
  • i figured this out by just guessing.  The rows start with A and i just have to manually figure it out.
    Monday, December 24, 2012 6:34 PM
  • You could copy the following macro into a module in your default template Normal.dotm:

    Sub GetCellAddress()
        Dim lngRow As Long
        Dim lngCol As Long
        If Selection.Information(wdWithInTable) Then
            lngRow = Selection.Cells(1).RowIndex
            lngCol = Selection.Cells(1).ColumnIndex
            MsgBox "Address of (first) cell in selection is " & _
                Chr(64 + lngCol) & lngRow, vbInformation
        Else
            MsgBox "Selection not within table.", vbInformation
        End If
    End Sub

    If you assign it to a Quick Access Toolbar button and/or a custom keyboard shortcut, you can quickly get information about the cell containing the insertion point.

    Regards, Hans Vogelaar

    • Marked as answer by iworkhere Tuesday, December 25, 2012 3:10 PM
    Monday, December 24, 2012 8:12 PM