SUMIF CODE

  • Thread starter Thread starter ezil
  • Start date Start date
E

ezil

What is wrong with this statement it igves "expected end of statement" error
msg.

sub abc()
pos=15
Range(Cells(3, 2), Cells(pos, 2)) = "=SUMIF(A2:A5,">10")"
end sub
 
Double up the double quotes in strings in your VBA code:

Range(Cells(3, 2), Cells(pos, 2)) = "=SUMIF(A2:A5,"">10"")"
 

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

Back
Top