Autres testez la version beta 1.0 de mon vba Indenter

patricktoulon

XLDnaute Barbatruc
Bonjour à tous
je vous présente la version beta 1.0 du Vba indenter by patricktoulon
je la met ici afin que vous la testiez
elle n'agit pas sur les module pour l'instant elle travaille sur un textbox
il faut quand même activer l'accès approuvé au model du vbproject


il est bien entendu qu'a terme ce sera un XLA parfaitement intégré dans le VBE
pour l'instant je tiens à ce que l'on puisse trouver tout les petits défauts si on en trouve
j'attends vos retours
merci d'avance
 

Pièces jointes

  • Vba Indenter Patricktoulon.xlsm
    34.9 KB · Affichages: 18

Lolote83

XLDnaute Barbatruc
Re bonjour,
J'ai vu que tu as bien avancé, et l'interfasse est plutôt pas mal d'ailleurs.
Voici donc le module dans lequel j'ai fait un test
VB:
Option Explicit
'Application.DisplayAlerts = True       'Message d'alerte affiché

Sub Message()
    MsgBox "BONJOUR"
End Sub

Sub Cadre()
    'Aucune Bordure
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    Selection.Borders(xlEdgeLeft).LineStyle = xlNone
    Selection.Borders(xlEdgeTop).LineStyle = xlNone
    Selection.Borders(xlEdgeBottom).LineStyle = xlNone
    Selection.Borders(xlEdgeRight).LineStyle = xlNone
    Selection.Borders(xlInsideVertical).LineStyle = xlNone
    Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
    'Recoloriage
    Selection.Borders(xlDiagonalDown).LineStyle = xlNone
    Selection.Borders(xlDiagonalUp).LineStyle = xlNone
    With Selection.Borders(xlEdgeLeft)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = 5
    End With
    With Selection.Borders(xlEdgeTop)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = 5
    End With
    With Selection.Borders(xlEdgeBottom)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = 5
    End With
    With Selection.Borders(xlEdgeRight)
        .LineStyle = xlContinuous
        .Weight = xlThin
        .ColorIndex = 5
    End With
    With Selection.Borders(xlInsideVertical)
        If Selection.Borders(xlInsideVertical).LineStyle < 1 Then
            .LineStyle = xlContinuous
            .Weight = xlHairline
            .ColorIndex = 3
        End If
    End With
    With Selection.Borders(xlInsideHorizontal)
        If Selection.Borders(xlInsideHorizontal).LineStyle < 1 Then
            .LineStyle = xlContinuous
            .Weight = xlHairline
            .ColorIndex = 3
        End If
    End With
End Sub

Sub Centrage_Vertical()
    With Selection
        .VerticalAlignment = xlCenter
    End With
End Sub

Sub Commentaire()
    With Selection
        .AddComment
        .Comment.Text Text:="COMMENTAIRE"
        .Comment.Visible = True
    End With
End Sub

Sub Filtre_Auto()
    On Error GoTo Erreur_FiltreAuto
    Selection.AutoFilter
Erreur_FiltreAuto:
    Exit Sub
End Sub

Sub Fusion()
    If Selection.MergeCells = True Then     'Fusionné
        'On défusionne
        With Selection
            .HorizontalAlignment = xlGeneral
            .VerticalAlignment = xlCenter
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .ShrinkToFit = False
            .MergeCells = False
        End With
    Else
        'On fusionne
        With Selection
            .HorizontalAlignment = xlCenter
            .VerticalAlignment = xlCenter
            .WrapText = False
            .Orientation = 0
            .AddIndent = False
            .ShrinkToFit = False
            .MergeCells = True
        End With
    End If
End Sub

Sub HautGauche()
    'Positionne la cellule active en Haut et à Gauche de l'écran
    ActiveWindow.ScrollRow = ActiveCell.Row
    ActiveWindow.ScrollColumn = ActiveCell.Column
End Sub

Sub AfficheMasque_Grille()
    If ActiveWindow.DisplayGridlines = False Then
        ActiveWindow.DisplayGridlines = True
    Else
        ActiveWindow.DisplayGridlines = False
    End If
End Sub

Sub Protection()
    ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True
End Sub

Sub RenvoiLigneAuto()
    If Selection.WrapText = False Then
        Selection.WrapText = True
    Else
        Selection.WrapText = False
    End If
End Sub

Sub AfficheMasqueZéro()
    If ActiveWindow.DisplayZeros = True Then
        ActiveWindow.DisplayZeros = False
    Else
        ActiveWindow.DisplayZeros = True
    End If
End Sub

Sub MêmeHauteur_MêmeLargeur()
    'Faire une selection de plusieurs cellules et lancer la macro
    For Each xCell In Selection
        xCell.RowHeight = xCell.Width
    Next
End Sub

Sub Euro()
    Selection.NumberFormat = "#,##0.00 $"
End Sub

Sub CalculAutomatique()
    Application.Calculation = xlAutomatic
End Sub

Sub AfficheHauteurLigne()
    MsgBox "Faire une selection de plusieures ligne"
    Dim xCell
    With ActiveSheet
        For Each xCell In Selection
            xCell.Value = xCell.RowHeight
        Next xCell
    End With
End Sub

Pour info, j'ai fait un test sur un autre module et aucun problème rencontré .....
@+ Lolote83
 

patricktoulon

XLDnaute Barbatruc
re
ho punaise c'est du rapide là
Merci Bernard et David

je pensais avoir le temps de la changer pour la version 1.4
qui inclue les mises à jour suivantes
mémorisation des préférences (les checkboxs)
blocage si on tente de modifier du code dans le xlam par le menu contextuel
ajout de la prise en charge des lignes de code sur plusieurs lignes avec les " & _"
et quelque autres petites choses aussi
 

Dudu2

XLDnaute Barbatruc
Waouh ! Ça fuse les posts !
@patricktoulon, un truc difficile... Pas grave sinon.
1714759404270.png
 

Statistiques des forums

Discussions
312 493
Messages
2 088 952
Membres
103 989
dernier inscrit
jralonso