Add formula in the code

  • Thread starter Thread starter Annette
  • Start date Start date
A

Annette

How would I add this formula into the code on Sheet2?

=SUMIF(Sheet1!B:B,"warrant",Sheet1!C:C)
 
What does that mean - add it into the code on sheet2?

If you wanted to use code to enter that formula in a cell you would do:

Worksheets("Sheet2").Range("F6").Formula = _
"=SUMIF(Sheet1!B:B,""warrant"",Sheet1!C:C)"
 
Very intuitive and just what I needed ... this makes sense and also helps me
for the other formulas! Thanks!
 
TIP
To enter formula down a column:
With Range("D7:D27")
.FormulaR1C1 = "=somefunction(RC1)"
End With
 

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