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

Résolu
dhaze Messages postés 113 Statut Membre -  
dhaze Messages postés 113 Statut Membre -
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 4246 Statut Contributeur 954
 
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 113 Statut Membre
 
C'était presque ça ;-)
Merci pour cette correction.

Bonne journée.
Lo.
0