ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Error in a formula (https://www.excelbanter.com/excel-discussion-misc-queries/2118-error-formula.html)

imej-clavier

Error in a formula
 
Hello,
Could somebody say to me what's wrong with my formula ,
Worksheets(2).Cells(22,7).Formula = WorksheetFunction.SumIf(Range([F16], _
[F16].End(xlDown)));"VRAI";Range([B16],[B16].End(xlDown)))
I have the following Message Box : Wanted : list separator or ]

Thank you in advance,


Jean-michel



JE McGimpsey

You have an extra parenthesis after the first xlDown, and I believe you
need to use commas rather than semicolons:

Worksheets(2).Cells(22, 7).Formula = _
WorksheetFunction.SumIf(Range([F16], [F16].End(xlDown)), _
"VRAI", Range([B16], [B16].End(xlDown)))

Alternatively, if you're trying to actually input the formula in the
cell, rather than the result (using English SUMIF - don't know what the
French is...):

Worksheets(2).Cells(22, 7).Formula = _
"=SumIf(" & Range([F16], [F16].End(xlDown)).Address & _
";""VRAI"";" & Range([B16], [B16].End(xlDown)).Address & ")"



In article ,
"imej-clavier" wrote:

Hello,
Could somebody say to me what's wrong with my formula ,
Worksheets(2).Cells(22,7).Formula = WorksheetFunction.SumIf(Range([F16], _
[F16].End(xlDown)));"VRAI";Range([B16],[B16].End(xlDown)))
I have the following Message Box : Wanted : list separator or ]

Thank you in advance,


Jean-michel



All times are GMT +1. The time now is 10:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com