excel vba - delete all rows except header and subtotal -
i'm using following code whereby have set range in filtered list , want delete visible cells. have offset 1 because of header row, have row @ bottom of code totals in last row, how can delete visible rows except last keep totals?
with rng .autofilter field:=5, criteria1:="<>*" & owner & "*" .offset(1, 0).specialcells(xlcelltypevisible).entirerow.delete end
thanks
try this
.autofilter field:=5, criteria1:="<>*" & owner & "*" activesheet.rows(250).hidden = true .offset(1, 0).specialcells(xlcelltypevisible).entirerow.delete
edit: post discussion in chat.
the row address never changes when autofilter. hide row after autofilter , done :)
Comments
Post a Comment