SUMIF in VBA

  • Thread starter Thread starter James C.
  • Start date Start date
J

James C.

Hi,

I am trying to code a SUMIF expression in VBA. I keep getting an error and
was hoping someone could assist.

Here is the formula (not in VBA Code):
=sumif('Annual Data'!Q:Q,"CLT",'Annual Data'!M:M)

I tried this (VBA):
SumIf(Sheets("Annual Data").Range(Q, Q), "CLT", Sheets("Annual
Data").Range(M, M))

Any help would be appreciated.
 
You range for columns is wrong

SumIf(Sheets("Annual Data").Range("Q:Q"), "CLT", Sheets("Annual
Data").Range("M:M"))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Excel Getting an annualized figure based on YTD in Excel 1
loop help 6
Delimma: SumIf worksheet function 0
sumif in vba 2
Refer a column in the 'sumif' function 2
Please help! 4
Sumif in 3d 4
Help with SUMIF in VBA 1

Back
Top