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
Post a Comment