View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jason V[_2_] Jason V[_2_] is offline
external usenet poster
 
Posts: 22
Default Getting the sum from filtering

I am still having trouble. Here is a sample spreadsheet

Green 2
Green 2
Blue 3
Red 4
Green 3

I want to filter on green and then sum the values (7) and then assign the
sum to a variable. I do not know the unfiltered range because it will
continue to grow. Do I select the whole column then?

Thanks
Jason V


"Mike H" wrote:

I should have added wher A2 :A8 is the unfiltered range

Mike
"Mike H" wrote in message
...
try

MyTot = WorksheetFunction.Subtotal(109, Range("A2:A8"))

Mike

"Jason V" wrote in message
...
I am trying to filter on a column and then I want to sum the result of the
visible rows. How do I fo this in code?

Thanks
--
Jason V