excel - How to delete All cells filtered witout headers using VBA? -


i new @ using vba , have difficulties creating vba code delete cells have been filtered out without deleting headers.

the code have below, not working if number of rows changes.

range("a6").select range(selection, selection. end(xltoright)).select selection.autofilter activesheet.range("$a$6:$ab$500").autofilter field:=28, criteria1:="0" rows("221:221").select range("o221").activate range(selection, selection.end(xldown)).select selection.delete shift:=xlup activesheet.showalldata 

one way...

activesheet.range("$a$7:$ab$500").specialcells(xlcelltypevisible).entirerow.delete 

Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -