Delete Hidden/Invisible Rows after Autofilter Excel VBA Part II -


new poster here.

i using below code in order filter name of firm in workbook. have multiple tabs labelled 1-11 i'd in.

sub filterbyfirm()  ' filterbyfirm macro    activesheet.range("$a$5:$qp$8000").autofilter field:=6, criteria1:= _     "ubs global asset management"  dim orow range, rng range dim myrows range sheets("3")     set myrows = intersect(.range("a:a").entirerow, .usedrange)     if myrows nothing exit sub end  each orow in myrows.columns(1).cells     if orow.entirerow.hidden         if rng nothing             set rng = orow         else             set rng = union(rng, orow)         end if     end if next  if not rng nothing rng.entirerow.delete end sub 

i have been going through , updating sheets("3") tab working in because seemed how make things work. however, did not work in tab 10 (called "10"). worked in every other tab, , not sure why. instead of filtering , deleting hidden rows, macro has been deleting rows.

how can correct this? , can confirm ubs appears in tab 10, not issue.

thank much!


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -