excel - How do I get the cell address of a table header cell? -
i'm using activesheet.listobjects(1).listcolumns(1)
pick table header cell , i'm using activesheet.listobjects(1).listcolumns(1).name
value of header. how address? example, i'd know if table header i'm targeting in column c
, row 3
.
i tried using activesheet.listobjects(1).listcolumns(1).address
doesn't seem right.
a listcolumn
has properties of databodyrange
, range
. range
includes header cell, can find first cell of range.
dim col listcolumn set col = activesheet.listobjects(1).listcolumns(1) msgbox col.databodyrange.address 'just data range msgbox col.range.address 'includes header cell msgbox col.range.cells(1).address 'the header cell
hint: creating reference col
means can make use of intellisense discover members of listcolumn object.
Comments
Post a Comment