ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to use SUMPRODUCT in macro? (https://www.excelbanter.com/excel-programming/326085-how-use-sumproduct-macro.html)

Tarek

How to use SUMPRODUCT in macro?
 
Dear all,

Now I m just testing and learned about SUMPRODUCT parameter of excel.
But actually, I need to translate and applicate in macro(i need the syntax).
So I can't solve it now!

Anyone can help me and feel greatly appreciate !

--
Regards,
Tarek ^^'

-----------------------
Tarek's WorkShop

Bob Phillips[_6_]

How to use SUMPRODUCT in macro?
 
Easiset way

Debug.Print
Evaluate("SUMPRODUCT(--(A1:A10=""abc""),--(B1:B10=17),C1:C10)")

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Tarek" wrote in message
...
Dear all,

Now I m just testing and learned about SUMPRODUCT parameter of excel.
But actually, I need to translate and applicate in macro(i need the

syntax).
So I can't solve it now!

Anyone can help me and feel greatly appreciate !

--
Regards,
Tarek ^^'

-----------------------
Tarek's WorkShop




Cora

How to use SUMPRODUCT in macro?
 
Dear You,

Is use this to put SUMPRODUCT in Vba's Macro :
ActiveSheet.Range("A1").Select
ActiveCell.FormulaR1C1Local = "=SUMPRODUCT(('C1:C10 = 1)*(D1:D10 =
"Ya"))"

And if you put only the result on the sheet:
ActiveCell.Value = ActiveCell.Value


"?B?VGFyZWs=?=" wrote in
:

Dear all,

Now I m just testing and learned about SUMPRODUCT parameter of
excel.
But actually, I need to translate and applicate in macro(i need the
syntax). So I can't solve it now!

Anyone can help me and feel greatly appreciate !



Bob Phillips[_6_]

How to use SUMPRODUCT in macro?
 

"Cora" wrote in message
...

Is use this to put SUMPRODUCT in Vba's Macro :
ActiveSheet.Range("A1").Select
ActiveCell.FormulaR1C1Local = "=SUMPRODUCT(('C1:C10 = 1)*(D1:D10 =
"Ya"))"


I think you must mean

ActiveCell.Formula = "=SUMPRODUCT((C1:C10 = 1)*(D1:D10 = ""Ya""))"



Cora

How to use SUMPRODUCT in macro?
 
"Bob Phillips" wrote in news:e7d9J
:

ActiveCell.FormulaR1C1Local = "=SUMPRODUCT(('C1:C10 = 1)*(D1:D10 =
"Ya"))"



No

ActiveCell.Formula = "=SUMPRODUCT((C1:C10 = 1)*(D1:D10 = ""Ya""))"

Didn't work (#Name? appears in cell)

ActiveCell.FormulaR1C1Local = "=SUMPRODUCT((C1:C10 = 1)*(D1:D10 = ""Ya""))"

Give the good result

Bob Phillips[_6_]

How to use SUMPRODUCT in macro?
 
Odd.

Can you try this for me?

ActiveCell.Formula = "=SOMMEPROD((C1:C10 = 1)*(D1:D10 = ""Ya""))"



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Cora" wrote in message
...
"Bob Phillips" wrote in news:e7d9J
:

ActiveCell.FormulaR1C1Local = "=SUMPRODUCT(('C1:C10 = 1)*(D1:D10 =
"Ya"))"



No

ActiveCell.Formula = "=SUMPRODUCT((C1:C10 = 1)*(D1:D10 = ""Ya""))"

Didn't work (#Name? appears in cell)

ActiveCell.FormulaR1C1Local = "=SUMPRODUCT((C1:C10 = 1)*(D1:D10 =

""Ya""))"

Give the good result




Cora

How to use SUMPRODUCT in macro?
 
"Bob Phillips" wrote in
:

Odd.

Can you try this for me?

ActiveCell.Formula = "=SOMMEPROD((C1:C10 = 1)*(D1:D10 = ""Ya""))"




Hello,

I've already try this formula. The result appear only when I edit cell with
F2 and Enter (I refer cells in an another workbook who is open in the same
macro).

When I use FormulaR1C1Local the result appear immediately.

bye


All times are GMT +1. The time now is 08:30 PM.

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