OVH Cloud OVH Cloud

Nb.Si dans VBA

12 réponses
Avatar
Guillaume
Bonjour a tous,

Comemnt faire pour écrire la fonction Nb.Si d'excel dans VBA

Voila le code

Private Sub CommandButton1_Click()
Dim maPlage As Range
Set maPlage = Worksheets("Vente Produits Février 2004").Range("A64:A6000")
reponse = Application.WorksheetFunction.Nb.Si(maPlage, "cells(1,1))
MsgBox reponse
End Sub

Ca marche pas... Pourquoi?
Quelqu'un peut m'aider?

Merci
Et bon Week End!!
lol

Guillaume

10 réponses

1 2
Avatar
Jessy Sempere [MVP]
Bonjour

Tu peux regarder du côté de SUMIF()

@+
Jessy Sempere - Access MVP

------------------------------------
Site @ccess : http://access.jessy.free.fr/
Pour l'efficacité de tous :
http://users.skynet.be/mpfa/
------------------------------------
"Guillaume" a écrit dans le message news:
#
Bonjour a tous,

Comemnt faire pour écrire la fonction Nb.Si d'excel dans VBA

Voila le code

Private Sub CommandButton1_Click()
Dim maPlage As Range
Set maPlage = Worksheets("Vente Produits Février 2004").Range("A64:A6000")
reponse = Application.WorksheetFunction.Nb.Si(maPlage, "cells(1,1))
MsgBox reponse
End Sub

Ca marche pas... Pourquoi?
Quelqu'un peut m'aider?

Merci
Et bon Week End!!
lol

Guillaume




Avatar
Guillaume
en fait je crois que c'est countif.... mais je sais pas comment ca
fonctionne

Merci de l'info

"Jessy Sempere [MVP]" a écrit dans le message de
news: c14rjb$be7$
Bonjour

Tu peux regarder du côté de SUMIF()

@+
Jessy Sempere - Access MVP

------------------------------------
Site @ccess : http://access.jessy.free.fr/
Pour l'efficacité de tous :
http://users.skynet.be/mpfa/
------------------------------------
"Guillaume" a écrit dans le message news:
#
Bonjour a tous,

Comemnt faire pour écrire la fonction Nb.Si d'excel dans VBA

Voila le code

Private Sub CommandButton1_Click()
Dim maPlage As Range
Set maPlage = Worksheets("Vente Produits Février
2004").Range("A64:A6000")


reponse = Application.WorksheetFunction.Nb.Si(maPlage, "cells(1,1))
MsgBox reponse
End Sub

Ca marche pas... Pourquoi?
Quelqu'un peut m'aider?

Merci
Et bon Week End!!
lol

Guillaume








Avatar
Modeste
;-)))
tsss.....tssss...
plutot :

COUNTIF
Counts the number of cells within a range that meet the
given criteria.
Syntax
COUNTIF(range,criteria)
Range : is the range of cells from which you want to
count cells.
Criteria : is the criteria in the form of a number,
expression, or text that defines which cells will be
counted. For example, criteria can be expressed as
32, "32", ">32", "apples".

'---------------------------
SUMIF
Adds the cells specified by a given criteria.
Syntax
SUMIF(range,criteria,sum_range)
Range is the range of cells you want evaluated.
Criteria is the criteria in the form of a number,
expression, or text that defines which cells will be
added. For example, criteria can be expressed as
32, "32", ">32", "apples".

Sum_range are the actual cells to sum.

@+

-----Message d'origine-----
Bonjour

Tu peux regarder du côté de SUMIF()

@+
Jessy Sempere - Access MVP

------------------------------------
Site @ccess : http://access.jessy.free.fr/
Pour l'efficacité de tous :
http://users.skynet.be/mpfa/
------------------------------------
"Guillaume" a écrit dans le message
news:

#
Bonjour a tous,

Comemnt faire pour écrire la fonction Nb.Si d'excel
dans VBA



Voila le code

Private Sub CommandButton1_Click()
Dim maPlage As Range
Set maPlage = Worksheets("Vente Produits Février
2004").Range("A64:A6000")


reponse = Application.WorksheetFunction.Nb.Si
(maPlage, "cells(1,1))


MsgBox reponse
End Sub

Ca marche pas... Pourquoi?
Quelqu'un peut m'aider?

Merci
Et bon Week End!!
lol

Guillaume





.




Avatar
Guillaume
Heu merci...

Donc en gros ca fait

toto = countif("A20:A300", "zaza")

Car ca marche po chez moi...

Désolé

Guillaume

"Modeste" a écrit dans le message de
news: 12f1f01c3f7aa$4a2781f0$
;-)))
tsss.....tssss...
plutot :

COUNTIF
Counts the number of cells within a range that meet the
given criteria.
Syntax
COUNTIF(range,criteria)
Range : is the range of cells from which you want to
count cells.
Criteria : is the criteria in the form of a number,
expression, or text that defines which cells will be
counted. For example, criteria can be expressed as
32, "32", ">32", "apples".

'---------------------------
SUMIF
Adds the cells specified by a given criteria.
Syntax
SUMIF(range,criteria,sum_range)
Range is the range of cells you want evaluated.
Criteria is the criteria in the form of a number,
expression, or text that defines which cells will be
added. For example, criteria can be expressed as
32, "32", ">32", "apples".

Sum_range are the actual cells to sum.

@+

-----Message d'origine-----
Bonjour

Tu peux regarder du côté de SUMIF()

@+
Jessy Sempere - Access MVP

------------------------------------
Site @ccess : http://access.jessy.free.fr/
Pour l'efficacité de tous :
http://users.skynet.be/mpfa/
------------------------------------
"Guillaume" a écrit dans le message
news:

#
Bonjour a tous,

Comemnt faire pour écrire la fonction Nb.Si d'excel
dans VBA



Voila le code

Private Sub CommandButton1_Click()
Dim maPlage As Range
Set maPlage = Worksheets("Vente Produits Février
2004").Range("A64:A6000")


reponse = Application.WorksheetFunction.Nb.Si
(maPlage, "cells(1,1))


MsgBox reponse
End Sub

Ca marche pas... Pourquoi?
Quelqu'un peut m'aider?

Merci
Et bon Week End!!
lol

Guillaume





.




Avatar
ChrisV
Bonjour Guillaume,

toto = Application.CountIf(Range("A20:A300"), "zaza")


ChrisV


"Guillaume" a écrit dans le message de news:

Heu merci...

Donc en gros ca fait

toto = countif("A20:A300", "zaza")

Car ca marche po chez moi...

Désolé

Guillaume

"Modeste" a écrit dans le message de
news: 12f1f01c3f7aa$4a2781f0$
;-)))
tsss.....tssss...
plutot :

COUNTIF
Counts the number of cells within a range that meet the
given criteria.
Syntax
COUNTIF(range,criteria)
Range : is the range of cells from which you want to
count cells.
Criteria : is the criteria in the form of a number,
expression, or text that defines which cells will be
counted. For example, criteria can be expressed as
32, "32", ">32", "apples".

'---------------------------
SUMIF
Adds the cells specified by a given criteria.
Syntax
SUMIF(range,criteria,sum_range)
Range is the range of cells you want evaluated.
Criteria is the criteria in the form of a number,
expression, or text that defines which cells will be
added. For example, criteria can be expressed as
32, "32", ">32", "apples".

Sum_range are the actual cells to sum.

@+

-----Message d'origine-----
Bonjour

Tu peux regarder du côté de SUMIF()

@+
Jessy Sempere - Access MVP

------------------------------------
Site @ccess : http://access.jessy.free.fr/
Pour l'efficacité de tous :
http://users.skynet.be/mpfa/
------------------------------------
"Guillaume" a écrit dans le message
news:

#
Bonjour a tous,

Comemnt faire pour écrire la fonction Nb.Si d'excel
dans VBA



Voila le code

Private Sub CommandButton1_Click()
Dim maPlage As Range
Set maPlage = Worksheets("Vente Produits Février
2004").Range("A64:A6000")


reponse = Application.WorksheetFunction.Nb.Si
(maPlage, "cells(1,1))


MsgBox reponse
End Sub

Ca marche pas... Pourquoi?
Quelqu'un peut m'aider?

Merci
Et bon Week End!!
lol

Guillaume





.








Avatar
Daniel.M
Hello,

toto = countif("A20:A300", "zaza")


toto = Application.Countif("A20:A300", "zaza")

Salutations,

Daniel M.

Avatar
Guillaume
ho merci super cool...

Guillaume
"Daniel.M" a écrit dans le message de
news: #
Hello,

toto = countif("A20:A300", "zaza")


toto = Application.Countif("A20:A300", "zaza")

Salutations,

Daniel M.





Avatar
Daniel.M
Oups. Oublié le Range

Donc:
toto = Application.Countif(Range"A20:A300", "zaza")

et ça devrait marcher.

Daniel M.


"Daniel.M" wrote in message
news:%
Hello,

toto = countif("A20:A300", "zaza")


toto = Application.Countif("A20:A300", "zaza")

Salutations,

Daniel M.





Avatar
Daniel.M
Oups bis. Oublié les parenthèses!

Pis je viens de voir le message de Chris (et ça ne lui a pas pris 3 essais pour
avoir la bonne réponse, LUI). :-)

Donc, veuillez ignorer complètement cette sous-ficelle. :-)

Daniel M.

"Daniel.M" wrote in message
news:
Oups. Oublié le Range

Donc:
toto = Application.Countif(Range"A20:A300", "zaza")

et ça devrait marcher.

Daniel M.


Avatar
Jacky
Ben Oui, il y a des jours comme cela....

Bon We
JJ

"Daniel.M" a écrit dans le message news:

Oups bis. Oublié les parenthèses!

Pis je viens de voir le message de Chris (et ça ne lui a pas pris 3 essais
pour

avoir la bonne réponse, LUI). :-)

Donc, veuillez ignorer complètement cette sous-ficelle. :-)

Daniel M.

"Daniel.M" wrote in message
news:
Oups. Oublié le Range

Donc:
toto = Application.Countif(Range"A20:A300", "zaza")

et ça devrait marcher.

Daniel M.






1 2