J'ai crée une fonction personnalisée matricielle qui renvoi un tableau dans
une plage de celulles
Seulement si le nombre de données que renvoie la fonction est inferieur au
nombre de celulles de la plage destination, la valeur #N/A complete la
partie manquante.
Y aurai t-il un moyen pour connaitre le nombre de celulle de la plage de
destination afin que je puisse initialiser mon tableau correctement et ne
plus avoir #N/A.
En résumé je cherche récupérer en VBA le nombre de celulle de la plage
concerneé par une fonction matricielle.
Est ce possible , pas sur.
Si quelqu'un a une idee ?
Avec un exemple et les résultats attendus, ça aiderait à avoir des idées... http://cjoint.com
AV
Ange Ounis
Par exemple :
Function MC(champ As Range) Dim retour() As Variant Dim k As Integer, i, j, l
ReDim retour(1 To Application.Caller.Count) Application.Volatile For i = 1 To champ.Areas.Count For j = 1 To champ.Areas(i).Count k = k + 1 retour(k) = champ.Areas(i)(j) Next j Next i
If k < Application.Caller.Count Then For l = k + 1 To Application.Caller.Count retour(l) = "" Next End If
MC = Application.Transpose(retour) End Function
---------- Ange Ounis ----------
Voila un exemple http://cjoint.com/?fpnh0RU1o5
damnou
"AV" a écrit dans le message de news:
| Si quelqu'un a une idee ?
Avec un exemple et les résultats attendus, ça aiderait à avoir des idées... http://cjoint.com
AV
Par exemple :
Function MC(champ As Range)
Dim retour() As Variant
Dim k As Integer, i, j, l
ReDim retour(1 To Application.Caller.Count)
Application.Volatile
For i = 1 To champ.Areas.Count
For j = 1 To champ.Areas(i).Count
k = k + 1
retour(k) = champ.Areas(i)(j)
Next j
Next i
If k < Application.Caller.Count Then
For l = k + 1 To Application.Caller.Count
retour(l) = ""
Next
End If
MC = Application.Transpose(retour)
End Function
----------
Ange Ounis
----------
Voila un exemple http://cjoint.com/?fpnh0RU1o5
damnou
"AV" <alainPFFFvallon@wanadoo.fr> a écrit dans le message de news:
u3ATwZAeGHA.3952@TK2MSFTNGP04.phx.gbl...
| Si quelqu'un a une idee ?
Avec un exemple et les résultats attendus, ça aiderait à avoir des
idées...
http://cjoint.com
Function MC(champ As Range) Dim retour() As Variant Dim k As Integer, i, j, l
ReDim retour(1 To Application.Caller.Count) Application.Volatile For i = 1 To champ.Areas.Count For j = 1 To champ.Areas(i).Count k = k + 1 retour(k) = champ.Areas(i)(j) Next j Next i
If k < Application.Caller.Count Then For l = k + 1 To Application.Caller.Count retour(l) = "" Next End If
MC = Application.Transpose(retour) End Function
---------- Ange Ounis ----------
Voila un exemple http://cjoint.com/?fpnh0RU1o5
damnou
"AV" a écrit dans le message de news:
| Si quelqu'un a une idee ?
Avec un exemple et les résultats attendus, ça aiderait à avoir des idées... http://cjoint.com
AV
damnou
ReDim retour(1 To Application.Caller.Count)
Merci , c'est exactement ce que je cherchais je l'avais déja utilise il y a longtemps et oublié
Damnou "Ange Ounis" a écrit dans le message de news: u$
Par exemple :
Function MC(champ As Range) Dim retour() As Variant Dim k As Integer, i, j, l
ReDim retour(1 To Application.Caller.Count) Application.Volatile For i = 1 To champ.Areas.Count For j = 1 To champ.Areas(i).Count k = k + 1 retour(k) = champ.Areas(i)(j) Next j Next i
If k < Application.Caller.Count Then For l = k + 1 To Application.Caller.Count retour(l) = "" Next End If
MC = Application.Transpose(retour) End Function
---------- Ange Ounis ----------
Voila un exemple http://cjoint.com/?fpnh0RU1o5
damnou
"AV" a écrit dans le message de news:
| Si quelqu'un a une idee ?
Avec un exemple et les résultats attendus, ça aiderait à avoir des idées... http://cjoint.com
AV
ReDim retour(1 To Application.Caller.Count)
Merci , c'est exactement ce que je cherchais
je l'avais déja utilise il y a longtemps et oublié
Damnou
"Ange Ounis" <nospam@nospam> a écrit dans le message de news:
u$7EgPFeGHA.2456@TK2MSFTNGP04.phx.gbl...
Par exemple :
Function MC(champ As Range)
Dim retour() As Variant
Dim k As Integer, i, j, l
ReDim retour(1 To Application.Caller.Count)
Application.Volatile
For i = 1 To champ.Areas.Count
For j = 1 To champ.Areas(i).Count
k = k + 1
retour(k) = champ.Areas(i)(j)
Next j
Next i
If k < Application.Caller.Count Then
For l = k + 1 To Application.Caller.Count
retour(l) = ""
Next
End If
MC = Application.Transpose(retour)
End Function
----------
Ange Ounis
----------
Voila un exemple http://cjoint.com/?fpnh0RU1o5
damnou
"AV" <alainPFFFvallon@wanadoo.fr> a écrit dans le message de news:
u3ATwZAeGHA.3952@TK2MSFTNGP04.phx.gbl...
| Si quelqu'un a une idee ?
Avec un exemple et les résultats attendus, ça aiderait à avoir des
idées...
http://cjoint.com
Merci , c'est exactement ce que je cherchais je l'avais déja utilise il y a longtemps et oublié
Damnou "Ange Ounis" a écrit dans le message de news: u$
Par exemple :
Function MC(champ As Range) Dim retour() As Variant Dim k As Integer, i, j, l
ReDim retour(1 To Application.Caller.Count) Application.Volatile For i = 1 To champ.Areas.Count For j = 1 To champ.Areas(i).Count k = k + 1 retour(k) = champ.Areas(i)(j) Next j Next i
If k < Application.Caller.Count Then For l = k + 1 To Application.Caller.Count retour(l) = "" Next End If
MC = Application.Transpose(retour) End Function
---------- Ange Ounis ----------
Voila un exemple http://cjoint.com/?fpnh0RU1o5
damnou
"AV" a écrit dans le message de news:
| Si quelqu'un a une idee ?
Avec un exemple et les résultats attendus, ça aiderait à avoir des idées... http://cjoint.com