OVH Cloud OVH Cloud

RE transformation de proc

5 réponses
Avatar
Paul
Bonsoir, j'ai cette proc qui fonctionne très bien, mais je souhaite qu'elle
fonctionnât de la plage A3:E200
Merci beaucoup


Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static memo As Range
Dim addr As Range
Set addr = Range("A" & Target.Row & ":E" & Target.Row)
If Target.Column < 6 Then
If addr.Interior.ColorIndex <> xlNone Then
With addr
.Interior.ColorIndex = xlNone
.Font.ColorIndex = 0
End With
Else
With addr
If Not memo Is Nothing Then
With memo
.Interior.ColorIndex = xlNone
.Font.ColorIndex = 0
End With
End If
Set memo = addr
.Interior.ColorIndex = 6
.Font.ColorIndex = 3
End With
End If
End If
End Sub

5 réponses

Avatar
sabatier
t'en ferais pas un peu trop là, paul
jps

Paul a écrit:
... mais je souhaite qu'elle fonctionnât...


Avatar
Paul
Euh...
Il m'en souvient que nous parlions un français aussi propre jadis.
N'est-il pas cher Monsieur ?
Amicalement.
Paul


"sabatier" a écrit dans le message
de news:
t'en ferais pas un peu trop là, paul
jps

Paul a écrit:
... mais je souhaite qu'elle fonctionnât...





Avatar
isabelle
bonjour Paul,

t'en ferais pas un peu trop là, paul


mais non oyons :-)

remplace la ligne
If Target.Column < 6 Then
par
If Target.Column < 6 and Target.row >=3 and Target.row > 0 Then

isabelle


Bonsoir, j'ai cette proc qui fonctionne très bien, mais je souhaite qu'elle
fonctionnât de la plage A3:E200
Merci beaucoup

Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static memo As Range
Dim addr As Range
Set addr = Range("A" & Target.Row & ":E" & Target.Row)
If Target.Column < 6 Then
If addr.Interior.ColorIndex <> xlNone Then
With addr
.Interior.ColorIndex = xlNone
.Font.ColorIndex = 0
End With
Else
With addr
If Not memo Is Nothing Then
With memo
.Interior.ColorIndex = xlNone
.Font.ColorIndex = 0
End With
End If
Set memo = addr
.Interior.ColorIndex = 6
.Font.ColorIndex = 3
End With
End If
End If
End Sub


Avatar
isabelle
oup's p'titit correction
If Target.Column < 6 And Target.Row >= 3 And Target.Row <= 200 Then

isabelle


Bonsoir, j'ai cette proc qui fonctionne très bien, mais je souhaite qu'elle
fonctionnât de la plage A3:E200
Merci beaucoup

Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static memo As Range
Dim addr As Range
Set addr = Range("A" & Target.Row & ":E" & Target.Row)
If Target.Column < 6 Then
If addr.Interior.ColorIndex <> xlNone Then
With addr
.Interior.ColorIndex = xlNone
.Font.ColorIndex = 0
End With
Else
With addr
If Not memo Is Nothing Then
With memo
.Interior.ColorIndex = xlNone
.Font.ColorIndex = 0
End With
End If
Set memo = addr
.Interior.ColorIndex = 6
.Font.ColorIndex = 3
End With
End If
End If
End Sub


Avatar
Paul
Merci gente dame pour votre diligence.
Votre.
Paul

"isabelle" a écrit dans le message de
news:
oup's p'titit correction
If Target.Column < 6 And Target.Row >= 3 And Target.Row <= 200 Then

isabelle


Bonsoir, j'ai cette proc qui fonctionne très bien, mais je souhaite
qu'elle


fonctionnât de la plage A3:E200
Merci beaucoup

Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Static memo As Range
Dim addr As Range
Set addr = Range("A" & Target.Row & ":E" & Target.Row)
If Target.Column < 6 Then
If addr.Interior.ColorIndex <> xlNone Then
With addr
.Interior.ColorIndex = xlNone
.Font.ColorIndex = 0
End With
Else
With addr
If Not memo Is Nothing Then
With memo
.Interior.ColorIndex = xlNone
.Font.ColorIndex = 0
End With
End If
Set memo = addr
.Interior.ColorIndex = 6
.Font.ColorIndex = 3
End With
End If
End If
End Sub