0

Could someone please identify where the error is?

Sub calc_external_sales()
    Sheets("Monetary All").[C5].Formula = "=SUMMEWENNS(Rawdata!K2:K3446;Rawdata!I2:I3446;""bezahlt"")"
End Sub

I guess it has to do with the sheets and the range.

2 Answers 2

1

perhaps

Sub calc_external_sales()
    Sheets("Monetary All").[C5].Formula = "=SUMIF(Rawdata!K2:K3446,Rawdata!I2:I3446,""bezahlt"")"
End Sub

or

Sub calc_external_sales()
    Sheets("Monetary All").[C5].FormulaLocal = "=SUMMEWENNS(Rawdata!K2:K3446;Rawdata!I2:I3446;""bezahlt"")"
End Sub
Sign up to request clarification or add additional context in comments.

Comments

0

The problem is that when you are using the quotes around your search criteria ("bezahlt"), it is effectively treating it as two strings that are adjacent to each other with no concatenation. Use this instead:

Sub calc_external_sales()
    Sheets("Monetary All").[C5].Formula = "=SUMMEWENNS(Rawdata!K2:K3446,Rawdata!I2:I3446," & Chr(34) & "bezahlt" & Chr(34) & ")"
End Sub

The chr(34) is the symbol for quotation marks.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.