View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Jean-Yves[_2_] Jean-Yves[_2_] is offline
external usenet poster
 
Posts: 253
Default how to sum a column using vb

Hi,

Use sumIf
SUMIF(range to evaluate,criteria,sum_range)

Application.WorksheetFunction.SumIf(Columns("A"), "Y", Columns("B"))

Regards

JY



"smason" wrote in message
...
i have two columns in excel the first column contains some cells with Y

(for
yes) in them and N (for no) the second column contains a financial amount
i.e. £5.00 next to each letter (Y or N)

i want to create a cmd button which contains an 'if' statement to sum all
the financial cells where the cells next to it contains "Y"

i.e.

column 1 Column 2
y £5
y £5
n £5

sum = £10.00