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

Résolu
dhaze Messages postés 109 Date d'inscription   Statut Membre Dernière intervention   -  
dhaze Messages postés 109 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.
A voir également:

1 réponse

Mytå Messages postés 2973 Date d'inscription   Statut Contributeur Dernière intervention   953
 
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
dhaze Messages postés 109 Date d'inscription   Statut Membre Dernière intervention  
 
C'était presque ça ;-)
Merci pour cette correction.

Bonne journée.
Lo.
0