IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Macros et VBA Excel Discussion :

Objet requis erreur VBA


Sujet :

Macros et VBA Excel

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Homme Profil pro
    Inscrit en
    Juillet 2012
    Messages
    201
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2012
    Messages : 201
    Par défaut Objet requis erreur VBA
    Bonjour à tous et à toutes,
    je suis débutant dans le monde de VBA(j'y connais pas grand chose) et nouveau sur ce forum,
    je souhaiterai soliciter votre aide. Je cherche à calculer le facteur de rayonnement d'une paroi en fonction de la fréquence d'excitation mais voilà j'ai un soucis dans mon programme que voici:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    Const pi As Single = 3.14
    Const c0 As Integer = 343
    Const rho As Single = 1.21
    
    Function sigma(f As Variant) As Variant
    End Function
    
    Public Sub rayonnement()
    
    Dim fc As Single
    Dim f11 As Single
    
    Dim sigma2 As Single
    Dim sigma3 As Single
    
    Dim Y As Variant
    
    Dim delta1 As Variant
    Dim delta2 As Variant
    
    Dim L1 As Integer
    Dim L2 As Integer
    L1 = 5
    L2 = 3
    
    fc = 111.65
    f11 = ((c0 ^ 2) / (4 * fc)) * ((1 / (L1 ^ 2)) + (1 / (L2 ^ 2)))
    
    Dim J As Integer
     J= 0
    
    For Each f In Range("Feuil1!B5:B25") '<< A Ajuster à ta plage ...
    
    sigma2 = 4 * L1 * L2 * ((f / c0) ^ 2)
    sigma3 = Sqr((2 * pi * f * (L1 + L2)) / (16 * c0))
    
    Y = Sqr(f / fc)
    If f11 <= (fc / 2) And f > fc Then ' => SI condition 1 validée ALORS
       sigma(f) = 1 / Sqr(1 - (fc / f)) 
    ElseIf f11 <= (fc / 2) And f < fc And f > (fc / 2) Then  ' => SINON, SI condition 2 validée ALORS
       delta1 = ((1 - (Y ^ 2)) * Log(((1 + Y) / (1 - Y)) + (2 * Y))) / (4 * ((pi) ^ 2) * ((1 - (Y ^ 2)) ^ (1.5)))
       delta2 = 0
       sigma(f) = (((2 * (L1 + L2) / (L1 * L2)) * (c0 / fc)) * delta1) + delta2
    ElseIf f11 <= (fc / 2) And f < (fc / 2) Then '=> SINON
       delta1 = ((1 - (Y ^ 2)) * Log(((1 + Y) / (1 - Y)) + (2 * Y))) / (4 * ((pi) ^ 2) * ((1 - (Y ^ 2)) ^ (1.5)))
       delta2 = (8 * (c0 ^ 2) * (1 - (2 * (Y ^ 2)))) / ((fc ^ 2) * (pi ^ 4) * L1 * L2 * Y * Sqr(1 - (Y ^ 2)))
       sigma(f) = (((2 * (L1 + L2) / (L1 * L2)) * (c0 / fc)) * delta1) + delta2
    ElseIf f11 < (fc / 2) And f < f11 And sigma(f) > sigma2 Then
       sigma(f) = sigma2
     
    ElseIf f11 > (fc / 2) And f < fc And sigma2 < sigma3 Then
       sigma(f) = sigma2
    
    ElseIf f11 > (fc / 2) And f > fc And (1 / Sqr(1 - (fc / f))) < sigma3 Then
       sigma(f) = 1 / Sqr(1 - (fc / f))
    
    ElseIf f11 > (fc / 2) And f > fc And (1 / Sqr(1 - (fc / f))) > sigma3 Then
       sigma(f) = sigma3
    
    End If
     
          J = J + 1
          Sheets("Feuil3").Cells(J, 3).Value = sigma(f)
    
    Next
     
    End Sub
    quand j'execute le programme le message suivant apparait :
    erreur d'execution 424 objet requis
    pour les lignes en gras et en italiques .
    Merci pour votre aide.

  2. #2
    Membre émérite Avatar de issoram
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2009
    Messages
    665
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Saône et Loire (Bourgogne)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2009
    Messages : 665
    Par défaut
    Bonjour

    sigma est une fonction définie en haut de ton code:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    Function sigma(f As Variant) As Variant
    End Function
    Donc une affectation du type
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    sigma(f) = 1 / Sqr(1 - (fc / f))
    me parait bizarre.
    D'autre part ta fonction sigma ne renvoie rien.

  3. #3
    Membre confirmé
    Homme Profil pro
    Inscrit en
    Juillet 2012
    Messages
    201
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2012
    Messages : 201
    Par défaut
    en fait au début je n'ai pas définit sigma comme une fonction ( et ça marchait très bien) mais comme dans une autre procédure je fais de nouveau appel à sigma pour différentes zone de f (f<fc, f=fc, f>fc) celle ci considére sigma comme égal à zéro. (Sigma est en fait une distribution de fonctions )

    voilà le programme qui marche :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    Const pi As Single = 3.14
    Dim f As Variant
    Const c0 As Integer = 343
    Const rho As Single = 1.21
     
    Public Sub rayonnement()
     
    Dim fc As Single
    Dim f11 As Single
     
    Dim sigma As Variant
    Dim sigma2 As Single
    Dim sigma3 As Single
     
    Dim Y As Variant
     
    Dim delta1 As Variant
    Dim delta2 As Variant
     
    Dim L1 As Integer
    Dim L2 As Integer
    L1 = 5
    L2 = 3
     
    fc = 111.65
    f11 = ((c0 ^ 2) / (4 * fc)) * ((1 / (L1 ^ 2)) + (1 / (L2 ^ 2)))
     
    Dim J As Integer
    J = 0
     
    For Each f In Range("Feuil1!B5:B25") '<< A Ajuster à ta plage ...
     
    sigma2 = 4 * L1 * L2 * ((f / c0) ^ 2)
    sigma3 = Sqr((2 * pi * f * (L1 + L2)) / (16 * c0))
     
    Y = Sqr(f / fc)
     
    If f11 <= (fc / 2) And f > fc Then ' => SI condition 1 validée ALORS
       sigma = 1 / Sqr(1 - (fc / f))
     
    ElseIf f11 <= (fc / 2) And f < fc And f > (fc / 2) Then  ' => SINON, SI condition 2 validée ALORS
       delta1 = ((1 - (Y ^ 2)) * Log(((1 + Y) / (1 - Y)) + (2 * Y))) / (4 * ((pi) ^ 2) * ((1 - (Y ^ 2)) ^ (1.5)))
       delta2 = 0
       sigma = (((2 * (L1 + L2) / (L1 * L2)) * (c0 / fc)) * delta1) + delta2
     
    ElseIf f11 <= (fc / 2) And f < (fc / 2) Then '=> SINON
       delta1 = ((1 - (Y ^ 2)) * Log(((1 + Y) / (1 - Y)) + (2 * Y))) / (4 * ((pi) ^ 2) * ((1 - (Y ^ 2)) ^ (1.5)))
       delta2 = (8 * (c0 ^ 2) * (1 - (2 * (Y ^ 2)))) / ((fc ^ 2) * (pi ^ 4) * L1 * L2 * Y * Sqr(1 - (Y ^ 2)))
       sigma = (((2 * (L1 + L2) / (L1 * L2)) * (c0 / fc)) * delta1) + delta2
     
    ElseIf f11 < (fc / 2) And f < f11 And sigma > sigma2 Then
       sigma = sigma2
     
    ElseIf f11 > (fc / 2) And f < fc And sigma2 < sigma3 Then
       sigma = sigma2
     
    ElseIf f11 > (fc / 2) And f > fc And (1 / Sqr(1 - (fc / f))) < sigma3 Then
       sigma = 1 / Sqr(1 - (fc / f))
     
    ElseIf f11 > (fc / 2) And f > fc And (1 / Sqr(1 - (fc / f))) > sigma3 Then
       sigma = sigma3
     
    End If
     
          J = J + 1
          Sheets("Feuil3").Cells(J, 3).Value = sigma
     
     
    Next
     
     
    End Sub
     
    Ensuite dans une autre procédure:
     
    Sub indice_affaiblissement()
     
    Dim sigma As Single
    Dim R As Single
    Dim Tau As Single
    Dim Ms, L1, L2 As Integer
    Ms = 460
    L1 = 5
    L2 = 3
     
    Dim J As Integer
    J = 0
    Dim fc As Single
    fc = 111.65
     
     
    For Each f In Range("Feuil1!B5:B25")
    If f > fc Then
      Tau = (((c0 * rho) / (pi * f * Ms)) ^ 2) * ((pi * fc * (sigma ^ 2)) / (2 * f))
     
    ElseIf f = fc Then
      Tau = (((c0 * rho) / (pi * f * Ms)) ^ 2) * ((pi * (sigma ^ 2)) / (2))
     
    ElseIf f < fc Then
      Tau = (((c0 * rho) / (pi * f * Ms)) ^ 2) * (2 * 0.5 * (Log((2 * pi * f / c0) * Sqr(L1 + L2)) - (-0.964 - ((0.5 + (L2 / (pi * L1))) * Log(L2 / L1)) + ((5 * L2) / (2 * pi * L1)) - (1 / (4 * pi * L1 * L2 * ((2 * pi * f / c0) ^ 2))))) + ((((L1 + L2) ^ 2) / ((L1 ^ 2) + (L2 ^ 2))) * Sqr(fc / f) * (sigma ^ 2)))
    End If
      J = J + 1
          Sheets("Feuil3").Cells(J, 5).Value = Tau
          'R = 10 * ((Log(1 / Tau)) / Log(10))
          'Sheets("Feuil3").Cells(J, 6).Value = R
    Next
     
    End Sub
    dans cette dernière procédure VBA renvoi un sigma nul dans les calculs de la transparence Tau.
    Comment faire pour lui envoyé les "bons" sigmas. je sais pas si j'ai été clair?Merci.

  4. #4
    Membre émérite Avatar de issoram
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Janvier 2009
    Messages
    665
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Saône et Loire (Bourgogne)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Janvier 2009
    Messages : 665
    Par défaut
    Là j'avoue que tu m'as un peu perdu. Essaie peut être d'être plus précis...

    De ce que je comprends, il te faut une fonction qui renvoie le bon sigma, pour pouvoir l'utiliser ensuite dans ton calcul de Tau.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    Function sigma (tes paramètres ici : L1,L2,fc, etc.) as single
        sigma =0 ' valeur par défaut à toi de la définir
        'ici tous tes calculs
    end function
     
    'Calcul de Tau
    Dim sgm as single
    sgm = sigma(tes paramètres)
    Tau =.....

  5. #5
    Membre confirmé
    Homme Profil pro
    Inscrit en
    Juillet 2012
    Messages
    201
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2012
    Messages : 201
    Par défaut
    voici le code que vous me conseillez donc :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    Const pi As Single = 3.14
     
    Const c0 As Integer = 343
    Const rho As Single = 1.21
    Dim fc As Single
    Dim f11 As Single
     
     
    Dim sigma2 As Single
    Dim sigma3 As Single
     
    Dim Y As Variant
     
    Dim delta1 As Variant
    Dim delta2 As Variant
     
    Dim L1 As Integer
    Dim L2 As Integer
     
     
     Dim f As Variant
     
     
     
     Public Function sigma(L1, L2, fc, f, delta1, delta2) As Single
     
        sigma = 0 ' valeur par défaut à toi de la définir
        Dim J As Integer
    J = 0
    L1 = 5
    L2 = 3
    fc = 111.65
    f11 = ((c0 ^ 2) / (4 * fc)) * ((1 / (L1 ^ 2)) + (1 / (L2 ^ 2)))
        '*************************************************
        For Each f In Range("Feuil3!B5:B25") '<--- l'erreur se situe ici
        '*************************************************
        sigma2 = 4 * L1 * L2 * ((f / c0) ^ 2)
        sigma3 = Sqr((2 * pi * f * (L1 + L2)) / (16 * c0))
     
        Y = Sqr(f / fc)
     
        If f11 <= (fc / 2) And f > fc Then ' => SI condition 1 validée ALORS
           sigma = 1 / Sqr(1 - (fc / f))
     
        ElseIf f11 <= (fc / 2) And f < fc And f > (fc / 2) Then  ' => SINON, SI condition 2 validée ALORS
           delta1 = ((1 - (Y ^ 2)) * Log(((1 + Y) / (1 - Y)) + (2 * Y))) / (4 * ((pi) ^ 2) * ((1 - (Y ^ 2)) ^ (1.5)))
           delta2 = 0
           sigma = (((2 * (L1 + L2) / (L1 * L2)) * (c0 / fc)) * delta1) + delta2
     
        ElseIf f11 <= (fc / 2) And f < (fc / 2) Then '=> SINON
           delta1 = ((1 - (Y ^ 2)) * Log(((1 + Y) / (1 - Y)) + (2 * Y))) / (4 * ((pi) ^ 2) * ((1 - (Y ^ 2)) ^ (1.5)))
           delta2 = (8 * (c0 ^ 2) * (1 - (2 * (Y ^ 2)))) / ((fc ^ 2) * (pi ^ 4) * L1 * L2 * Y * Sqr(1 - (Y ^ 2)))
           sigma = (((2 * (L1 + L2) / (L1 * L2)) * (c0 / fc)) * delta1) + delta2
     
        ElseIf f11 < (fc / 2) And f < f11 And sigma > sigma2 Then
           sigma = sigma2
     
        ElseIf f11 > (fc / 2) And f < fc And sigma2 < sigma3 Then
           sigma = sigma2
     
        ElseIf f11 > (fc / 2) And f > fc And (1 / Sqr(1 - (fc / f))) < sigma3 Then
           sigma = 1 / Sqr(1 - (fc / f))
     
        ElseIf f11 > (fc / 2) And f > fc And (1 / Sqr(1 - (fc / f))) > sigma3 Then
           sigma = sigma3
     
        End If
     
          J = J + 1
          Sheets("Feuil3").Cells(J, 3).Value = sigma
     
        Next
    End Function

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    Sub rayonnement()
     
     Dim f As Variant
     Dim R As Single
     Dim Tau As Single
     
    'Calcul de Tau
    Dim sgm As Single
    sgm = sigma(L1, L2, fc, f, delta1, delta2)
     
    For Each f In Range("Feuil3!B5:B25")
     
    If f > fc Then
      Tau = (((c0 * rho) / (pi * f * Ms)) ^ 2) * ((pi * fc * (sgma ^ 2)) / (2 * f))
     
    ElseIf f = fc Then
      Tau = (((c0 * rho) / (pi * f * Ms)) ^ 2) * ((pi * (sgma ^ 2)) / (2))
     
    ElseIf f < fc Then
       Tau = (((c0 * rho) / (pi * f * Ms)) ^ 2) * (2 * 0.5 * (Log((2 * pi * f / c0) * Sqr(L1 + L2)) - (-0.964 - ((0.5 + (L2 / (pi * L1))) * Log(L2 / L1)) + ((5 * L2) / (2 * pi * L1)) - (1 / (4 * pi * L1 * L2 * ((2 * pi * f / c0) ^ 2))))) + ((((L1 + L2) ^ 2) / ((L1 ^ 2) + (L2 ^ 2))) * Sqr(fc / f) * (sgma ^ 2)))
     
    End If
      J = J + 1
          Sheets("Feuil3").Cells(J, 5).Value = Tau
          R = 10 * ((Log(1 / Tau)) / Log(10))
          Sheets("Feuil4").Cells(J, 6).Value = R
    Next
     
    End Sub

    le problème qui s'affiche est cette fois : "la méthode "range" de l'objet global a échoué" (au niveau de la partie commentée)

    je vais tenter de reprendre tout ça demain matin et je vous tiens au courant, en tout cas merci pour votre aide j’apprécie beaucoup! :-)

  6. #6
    Membre confirmé
    Homme Profil pro
    Inscrit en
    Juillet 2012
    Messages
    201
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations forums :
    Inscription : Juillet 2012
    Messages : 201
    Par défaut
    Bonjour, voici mon dernier code:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    Const pi As Single = 3.14
    Dim f As Variant
     
    Dim fc As Single
    Dim L1 As Integer
    Dim L2 As Integer
    Const c0 As Integer = 343
    Const rho As Single = 1.21
     
     
    Public Function sigma(f, fc, L1, L2, delta1, delta2, c0, pi) As Single
    Dim f11 As Single
     
    Dim sigma2 As Variant
    Dim sigma3 As Variant
     
    L1 = 5
    L2 = 3
     
    fc = 111.65
    f11 = ((c0 ^ 2) / (4 * fc)) * ((1 / (L1 ^ 2)) + (1 / (L2 ^ 2)))
    sigma = 0
    Dim J As Integer
    J = 1
    For Each f In Range("Feuil1!B5:B25") '<< A Ajuster à ta plage ...
     
    sigma2 = 4 * L1 * L2 * ((f / c0) ^ 2)
    sigma3 = Sqr((2 * pi * f * (L1 + L2)) / (16 * c0))
     
    Y = Sqr(f / fc)
     
    If f11 <= (fc / 2) And f > fc Then ' => SI condition 1 validée ALORS
       sigma = 1 / Sqr(1 - (fc / f))
     
    ElseIf f11 <= (fc / 2) And f < fc And f > (fc / 2) Then  ' => SINON, SI condition 2 validée ALORS
       delta1 = ((1 - (Y ^ 2)) * Log(((1 + Y) / (1 - Y)) + (2 * Y))) / (4 * ((pi) ^ 2) * ((1 - (Y ^ 2)) ^ (1.5)))
       delta2 = 0
       sigma = (((2 * (L1 + L2) / (L1 * L2)) * (c0 / fc)) * delta1) + delta2
     
    ElseIf f11 <= (fc / 2) And f < (fc / 2) Then '=> SINON
       delta1 = ((1 - (Y ^ 2)) * Log(((1 + Y) / (1 - Y)) + (2 * Y))) / (4 * ((pi) ^ 2) * ((1 - (Y ^ 2)) ^ (1.5)))
       delta2 = (8 * (c0 ^ 2) * (1 - (2 * (Y ^ 2)))) / ((fc ^ 2) * (pi ^ 4) * L1 * L2 * Y * Sqr(1 - (Y ^ 2)))
       sigma = (((2 * (L1 + L2) / (L1 * L2)) * (c0 / fc)) * delta1) + delta2
     
    ElseIf f11 < (fc / 2) And f < f11 And sigma > sigma2 Then
       sigma = sigma2
     
    ElseIf f11 > (fc / 2) And f < fc And sigma2 < sigma3 Then
       sigma = sigma2
     
    ElseIf f11 > (fc / 2) And f > fc And (1 / Sqr(1 - (fc / f))) < sigma3 Then
       sigma = 1 / Sqr(1 - (fc / f))
     
    ElseIf f11 > (fc / 2) And f > fc And (1 / Sqr(1 - (fc / f))) > sigma3 Then
       sigma = sigma3
     
    End If
     
          J = J + 1
          Sheets("Feuil3").Cells(J, 3).Value = sigma
     
     
    Next
     For i = 1 To 10
    If Sheets("Feuil3").Cells(i, 3).Value = "" Then Cells(i, 3).Value = " facteur_rayonnement"
    Next i
    End Function
     
     
    Sub rayonnement()
     
     
    Dim R As Variant
    Dim Tau As Variant
    Dim Ms
    Ms = 460
    L1 = 5
    L2 = 3
    'Calcul de Tau
    Dim sgm As Single
    sgm = sigma(f, fc, L1, L2, delta1, delta2, c0, pi)
    Dim J As Integer
    J = 1
    fc = 111.65
    For Each f In Range("Feuil1!B5:B25")
    'rayonnement
    If f > fc Then
      Tau = (((c0 * rho) / (pi * f * Ms)) ^ 2) * ((pi * fc * (sgma ^ 2)) / (2 * f))
     
    ElseIf f = fc Then
      Tau = (((c0 * rho) / (pi * f * Ms)) ^ 2) * ((pi * (sgma ^ 2)) / (2))
     
    ElseIf f < fc Then
      Tau = (((c0 * rho) / (pi * f * Ms)) ^ 2) * (2 * 0.5 * (Log((2 * pi * f / c0) * Sqr(L1 + L2)) - (-0.964 - ((0.5 + (L2 / (pi * L1))) * Log(L2 / L1)) + ((5 * L2) / (2 * pi * L1)) - (1 / (4 * pi * L1 * L2 * ((2 * pi * f / c0) ^ 2))))) + ((((L1 + L2) ^ 2) / ((L1 ^ 2) + (L2 ^ 2))) * Sqr(fc / f) * (sgma ^ 2)))
    End If
      J = J + 1
          Sheets("Feuil3").Cells(J, 5).Value = Tau
           'R = 10 * ((Log(1 / Tau)) / Log(10))
          'Sheets("Feuil3").Cells(J, 6).Value = R
    Next
    End Sub
    cette fois VBA me calcul le bon sigma dans la fonction mais pour le rayonement avec sigm=sigma(paramètres) il me renvoi un sigm=0 pour mes 3 Tau du coup je récupère que la partie ou f<fc. pourquoi sigm=0? j'y arrive pas

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. VBA message d'erreur, objet requis
    Par yann26 dans le forum Macros et VBA Excel
    Réponses: 5
    Dernier message: 07/08/2014, 19h00
  2. Objet requis erreur 424
    Par mantus dans le forum Macros et VBA Excel
    Réponses: 8
    Dernier message: 02/09/2011, 10h28
  3. [DAO][VBA]Ajout d'enregistrement : erreur objet requis
    Par charlix dans le forum VBA Access
    Réponses: 7
    Dernier message: 22/04/2007, 16h02
  4. [VBA-E] erreur d'execution 424 - objet requis
    Par ludo02 dans le forum Macros et VBA Excel
    Réponses: 3
    Dernier message: 03/02/2007, 10h29
  5. [VBA E] erreur objet requis sur format horaire
    Par zoumzoum59 dans le forum Macros et VBA Excel
    Réponses: 4
    Dernier message: 25/06/2006, 18h30

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo