vba - Automate Excel Row Grouping based off another worksheet -


i have workbook has many sheets same roster of people on it. of them have left , "group by" ones no longer working here on sheet. however, there many tabs , easier group outline 1 tab , have macro copy outline rest of them.

example:

john. joe. susie. claire. adam.

if have 5 tabs, , on first 1 susie , adam grouped, use make susie , adam grouped in other tabs?

thanks in advance.

edit:

my latest code idea i've written in effort solve problem follows:

'delsum     sheet21      'resets group     .range("position").clearoutline      'groups principals     toprow = .range("position").find(what:="principal", lookin:=xlvalues, searchorder:=xlbyrows, searchdirection:=xlnext, matchcase:=true).row     bottomrow = .range("position").find(what:="principal", lookin:=xlvalues, searchorder:=xlbyrows, searchdirection:=xlprevious, matchcase:=true).row     toprow = toprow - 1      rows(toprow & ":" & bottomrow).group      end      'groups not work here     each cell in sheet21.range("lastmonth")         lastrow = cell.row         posrange = sheet21.range("b" & lastrow).value         if application.worksheetfunction.vlookup(posrange, sheet7.range("a5:l" & sheet7.range("a5").end(xldown).row), 9) = 1                 if cell.value = 0                     cell.rows.group                 end if         end if         next cell     end 

sheet7 master list of employees, 9th column denote if have left practice (with 1 meaning left). posrange refers name shows in first column of sheet7.

the issue script 1004 error on vlookup formula (error 1004 unable vlookup property). when @ posrange has person's name, , can see name in destination range.

create sheet (or "tab", say) called "active/inactive" listed roster folks in 1 column, , second column flag them "active" or "inactive". then, in every other sheet, insert column vlookup new "active/inactive" sheet. then, people added roster added sheet. since columns 1 sheet have manage in 1 place.

your "grouping" can accomplished using autofilter.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -