Identify Cell Location

T

tdbcalif

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
 
S

Stephanie Krieger

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
 
M

macropod

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top