Rechercher "[" et changer l'orientation dans la cellule

Résolu
dhaze Messages postés 113 Date d'inscription   Statut Membre Dernière intervention   -  
dhaze Messages postés 113 Date d'inscription   Statut Membre Dernière intervention   -
Bonsoir,

J'ai un petit souci avec cette macro

Sub Orientation_Entete_Colonne()

Dim Cellule As Object
Dim Entete_Colonne As Range

Set Entete_Colonne = Range(Cells(1, 1), Cells(1, 63))

For Each Cellule In Entete_Colonne
If Cellule.Value = "*[*" Then
Cellule.Orientation = xlVertical
End If
Next Cellule

End Sub


C'est la recherche du caractère "[" qui semble poser problème...

Lo.

1 réponse

  1. Mytå Messages postés 4246 Date d'inscription   Statut Contributeur Dernière intervention   958
     
    Salut le Forum

    A tester :
    Sub Orientation_Entete_Colonne()
    
        Dim Cellule As Object
        Dim Entete_Colonne As Range
    
        Set Entete_Colonne = Range(Cells(1, 1), Cells(1, 63))
    
        For Each Cellule In Entete_Colonne
            If InStr(Cellule.Value, "[") Then
                Cellule.Orientation = xlVertical
            End If
        Next Cellule
    
    End Sub

    Mytå
    0
    1. dhaze Messages postés 113 Date d'inscription   Statut Membre Dernière intervention  
       
      C'était presque ça ;-)
      Merci pour cette correction.

      Bonne journée.
      Lo.
      0