Code VBA et plage d intervention

Bonjour

J'ai un code VBA qui intervient sur la plage A15: L50.

Je souhaiterais l'écrire pour qu'il intervienne sur les plages A15 : F50 et I 15: L50 (c'est a dire pas sur la plage G15:E50)

Ci dessous le code

Merci

Ta

CODE ACTUEL

Private Sub Worksheet_Change(ByVal Target As Range)

With Target

If .Count > 1 Then Exit Sub

If Intersect(Target, [A15:L50]) Is Nothing Then Exit Sub

Application.EnableEvents = False

.Value = UCase$(.Value)

With .Font

.Size = 18: .Bold = True

Application.EnableEvents = True

End With

End With

End sub

Bonjour,

Voici la solution

Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Count > 1 Then Exit Sub
If Intersect(Target, range("A15:F50"), range("I15:L50")) Is Nothing Then Exit Sub

Application.EnableEvents = False
.Value = UCase$(.Value)
With .Font
.Size = 18: .Bold = True
Application.EnableEvents = True
End With
End With
End sub

Cordialement

Bonjour,

Salut besoin d'aide.

autre proposition

If Intersect(Target, Range("A15:F50")) Is Nothing And Intersect(Target, Range("I15:L50")) Is Nothing Then Exit Sub

bonjour,

autre possibilité (pour rester dans ton optique...)

Private Sub Worksheet_Change(ByVal Target As Range)
With Target
    If .Count > 1 Then Exit Sub
    If Intersect(Target, [A15:F50,I15:L50]) Is Nothing Then Exit Sub
    Application.EnableEvents = False
    .Value = UCase$(.Value)
        With .Font
            .Size = 18: .Bold = True
        End With
    Application.EnableEvents = True
End With
End Sub

A+

Bonjour

Merci beaucoup pour les réponses, j'ai trouvé mon bonheur

A une prochaine

TA

Rechercher des sujets similaires à "code vba plage intervention"