Ed was telling us:
Ed nous racontait que :
I have a large table with several named ranges. How can I find which
named range a particular cell is a part of?
Named ranges are an Excel thing, but tables are a Word thing... So I will
assume that by Named range you mean a bookmarked area in a Word document. If
part of a table is within a bookmark named "Test", then try this code:
Const BookMarkName As String = "Test"
If Not Selection.Information(wdWithInTable) Then
MsgBox "Selection must be in a table."
Exit Sub
End If
If
Selection.Cells(1).Range.InRange(ActiveDocument.Bookmarks(BookMarkName).Range)
Then
MsgBox "Current cell is in the """ & BookMarkName & """ range."
Else
MsgBox "Current cell is NOT in the """ & BookMarkName & """ range."
End If
If you mean Excel Named range, post again in an Excel group.
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:
http://www.word.mvps.org