Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding row/column of clicked object within a table

Status
Not open for further replies.

simon1tan

MIS
Aug 3, 2011
7
US
I'm trying to find the row and column of a checkbox within a table. When I click on the checkbox, I want to know what row and column I am in. Any ideas?
 


hi,

what application?

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
hi,

what application?
Skip,
so, you're asking the difficult questions first, eh, Skip?

Cheers, Glenn.

Beauty is in the eye of the beerholder.
 



We could try an If...Then...ElseIf....... response ;-)

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
selection.Information(wdEndOfRangeRowNumber)
and
selection.Information(wdEndOfRangeColumnNumber)

_________________
Bob Rashkin
 
Select the cell, then run the following macro, which displays the cell address on Word's status bar:
Code:
Sub CellAddress()
'This macro displays the address of a table cell on Word's status bar
If Selection.Information(wdWithInTable) = True Then
  If Selection.Cells(1).ColumnIndex > 26 Then
    StatusBar = "Cell Address: " & Chr(64 + Int(Selection.Cells(1).ColumnIndex / 26)) & _
    Chr(64 + (Selection.Cells(1).ColumnIndex Mod 26)) & Selection.Cells(1).RowIndex
  Else
    StatusBar = "Cell Address: " & Chr(64 + Selection.Cells(1).ColumnIndex) & _
    Selection.Cells(1).RowIndex
  End If
End If
End Sub

Cheers
Paul Edstein
[MS MVP - Word]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top