Greetings. I'm new to using VBA for word. I've used for Excel and Access.
How can I refer to the active cell in a Word table.
My Goal:
To use form fields in a word document.
Upon selection of a particular value in the form field list, I want to use
an exit macro to shade the cell that was just changed based on the value that
the user selected.
However, I can't determine with VBA which is the active cell
Any advice would be appreciated.
Thanks
Stephanie Krieger - 08 Nov 2004 23:53 GMT
Hi,
Here's the code you need:
Selection.tables(1).cell(selection.Information
(wdEndOfRangeRowNumber),selection.Information
(wdEndOfRangeColumnNumber)).Select
Hope that helps.
Best,
Stephanie Krieger
author of Microsoft Office Document Designer (from
Microsoft Learning)
email: MODD _ 2003 at msn dot com
blog: arouet.net
>-----Original Message-----
>Greetings. I'm new to using VBA for word. I've used for Excel and Access.
[quoted text clipped - 10 lines]
>Thanks
>.
macropod - 09 Nov 2004 09:50 GMT
Hi,
Try something based on:
Sub CellAddress()
If Selection.Information(wdWithInTable) = True Then
StatusBar = "Cell Address: " & Chr(64 + Selection.Cells(1).ColumnIndex)
& Selection.Cells(1).RowIndex
End If
End Sub
Cheers
PS: I seem to recall this macro or one like it being published by MS at one
time. It puts the currently-selected cell's address on the status bar.
> Greetings. I'm new to using VBA for word. I've used for Excel and Access.
> How can I refer to the active cell in a Word table.
[quoted text clipped - 8 lines]
>
> Thanks