vba - Macro to adjust an entire row in an Excel table at once -
i need way programatically adjust entire row in excel table based on activecell, irrespective of table it's in or table is. using
activesheet.listobjects(1).listrows(activecell.row - 1).range.select selection.style = "good"
but upon shifting table down 5 rows, applies action down further 5 rows activecell.
i've tried finding way replace - 1
sort of - .headerrowrange.row
nothing happens when activate macro.
you can take advantage of activecell.listobject
property. makes more flexible, e.g., if there's 2 tables in worksheet:
sub formatactivetablerow() dim lo excel.listobject set lo = activecell.listobject if not lo nothing intersect(activecell.entirerow, lo.range).style = "good" end if end sub
Comments
Post a Comment