Hi Community,
my question is:
I autofilter a table and want to store the average of the visible cells in column b in a variable to insert it on another sheet. My table starts in B2 but has a header.
'Filter Table
Range("B3").Select
ActiveCell.CurrentRegion.Select
Selection.AutoFilter Field:=1, Criteria1:="3"
' Assign variable to subtotal average
TotalF = Application.WorksheetFunction.Subtotal(101, Range("B:B")) - 3
If I insert the Value of TotalF, I get a wrong number.
Can anyone help??
Thanks a lot!!
|