1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| If x.Row <> [Z1] Then
pCel = [Z1].Value '
MsgBox "Nouvelle ligne trouvée " & x.Row & " pour l'article : " & c.Value & vbCrLf & _
"Ancienne ligne Z1 : " & [Z1] & vbCrLf & _
"Nbre de valeurs dans la ligne précédente " & [Z1].Value & " est " & Application.CountA(Range("N" & [Z1].Value & ":X" & [Z1].Value))
If Application.WorksheetFunction.CountA(Range("N" & pCel & ":X" & pCel)) > 1 Then
MsgBox "Ligne en traitement previous cell : " & pCel
Worksheets("Feuil2").Range("N" & pCel & ":X" & pCel).Name = "Prix"
Cells(pCel, 25).Activate
With ActiveCell
.Formula = "=AVERAGE(" & Range("Prix").Address(0, 0) & ")"
.ClearComments 'je supprime le commentaire existant
.AddComment 'je créé le commentaire
.Comment.Visible = True
.Comment.Text Text:=Range("M" & pCel).Text 'commentaire
.Comment.Shape.ScaleWidth 1.1, msoFalse, msoScaleFromTopLeft
.Comment.Shape.ScaleHeight 0.19, msoFalse, msoScaleFromTopLeft
End With
Else
Cells(pCel, 25).ClearComments
End If
[Z1].Value = x.Row
End If |
Partager