I am having some problem to understand how HeaderRowRange works. Lets see: According to the documentation:
headersRowrange is a Range
so this should work:
Dim ftsTbl As ListObject
Set ftsTbl = ThisWorkbook.Sheets(1).ListObjects(1)
MsgBox ("ftsTbl.HeaderRowRangeD1:" & ftsTbl.HeaderRowRange("D1").Address)
but it doesnt. (invalid procedure call or argument) Why? nor does the following work:
MsgBox ("ftsTbl.HeaderRowRangeD1:" & ftsTbl.HeaderRowRange("D1").item(1).Address)
What I really need to do is getting the following range in this listObject:
I need the range of the header of the listobject from D1 to D6 columns. I thought that I could use Range( cell1 ,cellX) like this:
Dim ftsTbl As ListObject
Set ftsTbl = ThisWorkbook.Sheets(1).ListObjects(1)
Dim DocsHeadersRange As Range
'Set DocsHeadersRange = ThisWorkbook.Sheets(1).Range(ftsTbl.HeaderRowRange("D1"), ftsTbl.ListColumns("D6").DataBodyRange.iTem(ftsTbl.ListRows))
But it does not work. Why?
I am defining a bunch of ranges in sheet(1) in order to use in
Sub Worksheet_SelectionChange(ByVal Target As Range)
Set Overlap = Intersect(***defined range of listobject***, Selection)
If Not Overlap Is Nothing Then
If Overlap.Areas.Count = 1 And Selection.Count = Overlap.Count Then
...etc
Thanks Cheers