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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -