Compléter macro

Bonjour le forum

J'ai cette partie de macro qui fonctionne bien mais je voudrais ajouter en plus

1 = colonne A

Pour les caractères =27 et = 2

Les couleurs et taille du texte sont les mêmes

Merci pour vos éventuels retours

         For Each Sh In .Shapes                                  'Ces 10 lignes pour ajouter une année.
       If Sh.TopLeftCell.Column = 7 Then                         '7 = Colonne G
        With Sh.TextFrame.Characters(Start:=51, Length:=4)
          .Insert An + 1                                         ' Incrémentation d'un an
          .Font.ColorIndex = 3                                   ' Couleur année
          .Font.Size = 16                                        ' Taille texte
        End With
        Exit For
      End If
    Next Sh

Bonjour,

Pas sûr d'avoir bien compris, mais est-ce cela?

    For Each Sh In .Shapes                                  'Ces 10 lignes pour ajouter une année.
        If Sh.TopLeftCell.Column = 7 Then                          '7 = Colonne G
            With Sh.TextFrame.Characters(Start:=51, Length:=4)
              .Insert An + 1                                         ' Incrémentation d'un an
              .Font.ColorIndex = 3                                   ' Couleur année
              .Font.Size = 16                                        ' Taille texte
            End With
            Exit For

        ElseIf Sh.TopLeftCell.Column = 1 Then
            With Sh.TextFrame.Characters(Start:=27, Length:=4)
              .Insert An + 1
              .Font.ColorIndex = 3
              .Font.Size = 16
            End With
            With Sh.TextFrame.Characters(Start:=2, Length:=4)
              .Insert An + 1
              .Font.ColorIndex = 3
              .Font.Size = 16
            End With
            Exit For
        End If
    Next Sh

Cdlt

Bonjour Arturo83

Tu as tout compris

Merci à toi et bonne fin de WE

Cordialement

Rechercher des sujets similaires à "completer macro"