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

Résolu/Fermé
dhaze Messages postés 109 Date d'inscription mardi 27 septembre 2011 Statut Membre Dernière intervention 6 février 2020 - 7 avril 2015 à 19:20
dhaze Messages postés 109 Date d'inscription mardi 27 septembre 2011 Statut Membre Dernière intervention 6 février 2020 - 9 avril 2015 à 07:59
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 mardi 20 janvier 2009 Statut Contributeur Dernière intervention 20 décembre 2016 942
7 avril 2015 à 21:22
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 mardi 27 septembre 2011 Statut Membre Dernière intervention 6 février 2020
9 avril 2015 à 07:59
C'était presque ça ;-)
Merci pour cette correction.

Bonne journée.
Lo.
0