Macro sélective
Résolu
gigipong
Messages postés
118
Date d'inscription
Statut
Membre
Dernière intervention
-
gigipong Messages postés 118 Date d'inscription Statut Membre Dernière intervention - 17 août 2021 à 16:09
gigipong Messages postés 118 Date d'inscription Statut Membre Dernière intervention - 17 août 2021 à 16:09
A voir également:
- Macro sélective
- Telecharger macro convertir chiffre en lettre excel - Télécharger - Tableur
- Jitbit macro recorder - Télécharger - Confidentialité
- Macro word - Guide
- Macro maker - Télécharger - Divers Utilitaires
- Télécharger macro convertir chiffre en lettre excel - Télécharger - Tableur
2 réponses
Bonjour,
comme cela
comme cela
Private Sub Worksheet_Change(ByVal Target As Range) Dim text As String text = Target.Value If Target.Column <> 4 And Target.Column <> 6 Then Exit Sub Target.Value = UCase(Left(text, 1)) + Mid(text, 2, Len(text)) End Sub
Re,
Une autre façon de l'écrire
ou encore
et si tu veux éviter le End If en fin de code et donc une ligne, il suffit d'ajouter un espace et le tiret du 8 après le Then _
End Sub
Une autre façon de l'écrire
Private Sub Worksheet_Change(ByVal Target As Range) Dim text As String text = Target.Value If Not Application.Intersect(Target, Union(Range("D:D"), Range("F:F"))) Is Nothing Then Target.Value = UCase(Left(text, 1)) + Mid(text, 2, Len(text)) End If End Sub
ou encore
Private Sub Worksheet_Change(ByVal Target As Range) Dim text As String text = Target.Value If Not Application.Intersect(Target, Union(Columns("D"), Columns("F"))) Is Nothing Then Target.Value = UCase(Left(text, 1)) + Mid(text, 2, Len(text)) End If End Sub
et si tu veux éviter le End If en fin de code et donc une ligne, il suffit d'ajouter un espace et le tiret du 8 après le Then _
Private Sub Worksheet_Change(ByVal Target As Range) Dim text As String text = Target.Value If Not Application.Intersect(Target, Union(Columns("D"), Columns("F"))) Is Nothing Then _ Target.Value = UCase(Left(text, 1)) + Mid(text, 2, Len(text))
End Sub
merci