Bonjour au forum,
Je cherche à améliorer le code qui a déjà été fait par un de vos membre, en donnant une mise en forme bordure à toutes les cellules qu'il a copié via le double clic
Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
'double click pour selection
Dim Reponse As Integer, LigneAjout As Integer
If Not Application.Intersect(Target, Range("Tableau1")) Is Nothing Then
Cancel = True
If Range("D2").Value = "" Then
MsgBox "Veuillez indiquer votre Nom et/ou prénom.", vbOKOnly + vbCritical
Range("D2").Select
Exit Sub
End If
Reponse = MsgBox("Vous avez choisi le code " & Cells(Target.Row, 1).Value & "." & Chr(10) & _
"Confirmez-vous ce choix ?", vbInformation + vbYesNo)
If Reponse = vbYes Then
With Worksheets("Récap commandes")
LigneAjout = .Range("A" & Rows.Count).End(xlUp)(2).Row
.Range("A" & LigneAjout) = Range("D2").Value
.Range("B" & LigneAjout).Resize(, 6) = Cells(Target.Row, 1).Resize(, 6).Value
.Activate
End With
End If
End If
End Sub
With Selection
.BorderAround Weight:=xlMedium
End With
With Activecell
.BorderAround Weight:=xlMedium
End With
J'ai essayé en ajoutant les 2 codes ci-dessus, ça me fait la mise en forme mais juste sur la cellule sélectionnée ou activée