excel - VBA Count Table Rows which Contain data -
this question has answer here:
- error in finding last used cell in vba 10 answers
follow on earlier question. trying count number of rows in table contain data (not counting number of rows part of table).
my code is:
with thisworkbook.worksheets(1) set atb = .listobjects("table1") .activate numberrows = .cells(.rows.count, "a").end(xlup).row end with`
this returns wrong number (trust me column has same data count)
likewise, want use vba resize table nicely need row count that.
try this
sub check() thisworkbook.worksheets("sheet1") set atb = .listobjects("table1") .activate numberrows = application.counta(.range("a:a")) end end sub
Comments
Post a Comment