yahya belbachir
XLDnaute Occasionnel
Bonjour
pour faire un calcul dans une feuil en vba,j'ai crée un code sur (worksheetfunction),le code suivant:
******************************
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lg As Long
lg = Cells(Rows.Count, "C").End(xlUp).Row
If Not Intersect(Target, Range("F2:F" & lg)) Is Nothing Then
Cells(lg, 6) = Cells(lg, 3) + Cells(lg, 4)
Range("A:G" & Target.Row).Borders.Weight = xlThin
End If
End Sub
****************************
mais ne fonctionne pas,pour être plus clair mon fichier çi joint.
merci
pour faire un calcul dans une feuil en vba,j'ai crée un code sur (worksheetfunction),le code suivant:
******************************
Private Sub Worksheet_Change(ByVal Target As Range)
Dim lg As Long
lg = Cells(Rows.Count, "C").End(xlUp).Row
If Not Intersect(Target, Range("F2:F" & lg)) Is Nothing Then
Cells(lg, 6) = Cells(lg, 3) + Cells(lg, 4)
Range("A:G" & Target.Row).Borders.Weight = xlThin
End If
End Sub
****************************
mais ne fonctionne pas,pour être plus clair mon fichier çi joint.
merci
Pièces jointes
Dernière édition: