excel - Automate a macro based on a change within a range from another sheet -


i trying automate macro run on sheet2 whenever cell within range on sheet1 changed. have tried bunch of things , don't have vba experience know wrong them. basically, sheet1 has input, , assigned level of priority 1-5 each item. sheet2 shows items ranked 1, 3, or 4. did if statements, leaves bunch of blank rows in table, can sort blank rows out using filter function. if change ranking on sheet1, want sheet2 table automatically update. wrote sort function resorts sheet2 data appropriately struggling automate updates automatically when sheet1 changed. far have been using worksheet_change , can sheet1 refilter when sheet1 changed, not want. ideas?

this current sort function:

sub resort()  worksheets("sheet2")     .range("$a$2:$d$34").autofilter field:=2      .range("$a$2:$d$34").autofilter field:=2, criteria1:="<>"  end  end sub 

this:

private sub worksheet_change(byval target range)      if not intersect(target, range("a:a")) nothing          '     end if  end sub  

should trick


Comments