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 -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

java - How to provide dependency injections in Eclipse RCP 3.x? -