I have a worksheet (Database) that gets sorted based upon a couple of user entries on another worksheet (Budget). Some calculations are done on the filered results which are passed back to the user entry sheet. The code I'm using is:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.AutoFilterMode = False
Range("A4:R1000").autofilter
Range("A4:R1000").autofilter field:=4, Criteria1:=Sheets("Budget").Range("D8").Text
Range("A4:R1000").autofilter field:=5, Criteria1:=Sheets("Budget").Range("D10").Text
End Sub
Which works great, except that I need to open the Database worksheet and make a selection to trigger the filter. How can I trigger so that the autofilter happens and the Budget sheet is updated without going to the database sheet?
Thanks.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
ActiveSheet.AutoFilterMode = False
Range("A4:R1000").autofilter
Range("A4:R1000").autofilter field:=4, Criteria1:=Sheets("Budget").Range("D8").Text
Range("A4:R1000").autofilter field:=5, Criteria1:=Sheets("Budget").Range("D10").Text
End Sub
Which works great, except that I need to open the Database worksheet and make a selection to trigger the filter. How can I trigger so that the autofilter happens and the Budget sheet is updated without going to the database sheet?
Thanks.