VBA Excel Erreur 13

Résolu
Bonjour,

j aimrai bien que vous m aider avec cette erreur que je renontre
mon code est le suivant :
Private Sub Worksheet_Activate()
Dim i As Double
i = 0
For i = 7 To 1000
    With Range("T" & i)
        For Each celulle In Range("T" & i)
            With Range("T" & i)

                    If IsEmpty(Range("T" & i).Value) <> "" Then
                         If .Comment Is Nothing Then Range("T" & i).AddComment
                         .Comment.Shape.TextFrame.AutoSize = True
                         .Comment.Text Text:="" & Range("AA" & i).Value & ""
                     End If

                 End With

          Next

        End With
        
Next

End Sub

merci pour tous



gros bravo

4 réponses

  1. Re,

    merci mais j ai besoin d ajouter le commentaire juste si les celulles contenne du text pas avec des commentaire vide Explication svp

    le code que je vous ai ecrit correspond a votre code corrige.
    1. merci mais j ai besoin d ajouter le commentaire juste si les celulles contenne du text pas avec des commentaire vide

      encore mille merci
      1. Bonjour,

        code simplifie:
        Private Sub Worksheet_Activate()
        Dim i As Double
        For i = 7 To 1000
        With Range("T" & i)
        If .Value <> "" Then
        If .Comment Is Nothing Then .AddComment
        .Comment.Shape.TextFrame.AutoSize = True
        .Comment.Text Text:="" & Range("AA" & i).Value & ""
        End If
        End With
        Next i
        End Sub