Récuper la formule d'une fonction

Bonjour

Je souhaiterai récupérer la formule d'une fonction d'un tableur.

La fonction s'appelle diamcol. cela me permettra de décortiquer la formule pour l'utiliser dans un autre tableur

merci d'avance pour toute aide

Bonjour,

merci de déposer le fichier sur le forum, ou sur un site plus simple comme cjoint s'il est trop gros.

eric

Bonjour,

Si j'ai compris la question.

Faire ALT+F11 pour ouvrir l'éditeur VBA. Dans Module1, tu découvriras 3 fonctions personnalisées

Function nbrobchas(nb)
  nbrobchas = 0
  If nb > 0 And nb <= 3 Then nbrobchas = 1
  If nb > 3 And nb <= 12 Then nbrobchas = 2
  If nb > 12 And nb <= 24 Then nbrobchas = 3
  If nb > 24 And nb <= 50 Then nbrobchas = 4
  If nb > 50 Then nbrobchas = 5
End Function
Function coefsim(X, min)
coefsim = 0
If X = 1 Then coefsim = 1
If X > 1 Then
  coefsim = 0.8 / (X - 1) ^ 0.5
  If coefsim < min Then coefsim = min
End If
End Function
Function diamcol(Q, eau, pt)
  If Q * pt > 0 Then
    X = eau '-- EU,EV,EP
    Q = Q / 1000
    pt = pt / 100
    cf = 0.16 '-- coef de frottement
    Pi = 3.141592654
    delta_SM = 1000000#
    D = 0
    While delta_SM > 0.01
      D = D + 0.0001 '--en m
      sm = Pi * D ^ 2 / 4 * X

      k = 87 * sm * Sqr(pt)
      RH = (0.5 * (Q / k + Sqr(Q ^ 2 / k ^ 2 + 4 * cf * Q / k))) ^ 2

      a = 2 * sm / D / RH
      y = 1
      If a < Pi Then y = -1
      temp_sm = (a / 8 * D ^ 2 + y * (D ^ 2 / 4 * Sin(y * (a - Pi) / 2) * Cos(y * (a - Pi) / 2)))
      delta_SM = Abs(sm - temp_sm) / sm

    Wend

 '   delta = 1000000#
 '   a = 0
 '   Pi = 3.141592654
 '   While delta > 0.01
 '     a = a + 0.02
 '     y = 1
 '     If a < Pi Then y = -1
 '     delta = Abs(SM - (a / 8 * (2 * SM / RH / a) ^ 2) + y * (2 * SM / RH / a) ^ 2 / 4 * Sin((a - Pi) / 2 * y) * Cos((a - Pi) / 2 * y))
 '   Wend
    diamcol = D * 1000 '-- en mm
  End If
End Function

Merci Jean Eric, c'est exactement ce que je recherchais.

Super sympa de ta part.

Re,

Clos le le sujet si tu es satisfait de la réponse.

Cdlt

Rechercher des sujets similaires à "recuper formule fonction"