- Katılım
- 25 Aralık 2007
- Mesajlar
- 335
- Excel Vers. ve Dili
- exel 2000 türkçe
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Son
If Intersect(Target, [C7:E65536]) Is Nothing Then Exit Sub
If Target.Row < 7 Then Exit Sub
If UCase(Cells(Target.Row, "C")) = "S" Then
Cells(Target.Row, "F") = Cells(Target.Row, "D") * Cells(Target.Row, "E")
Cells(Target.Row, "G") = 0
ElseIf UCase(Cells(Target.Row, "C")) = "A" Then
Cells(Target.Row, "G") = Cells(Target.Row, "D") * Cells(Target.Row, "E")
Cells(Target.Row, "F") = 0
End If
Son:
End Sub
bu kodda c sütununa s yazarsam d ve e yi carpıp f ye yazıyor a yazarsamda dyi ve e yi carpıp g ye yazıyor ancak c deki değişiklikleri algılamıyor
yani örnek:c7 ye s yazdım d7 ve e7 carptı sonucu f ye yazdı ama c7 deki s yi siler veya değiştirisem carpım sonucu gene f de kalıyor bunu silmesi gerekli
nasıl yapabilirim
saygılar
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo Son
If Intersect(Target, [C7:E65536]) Is Nothing Then Exit Sub
If Target.Row < 7 Then Exit Sub
If UCase(Cells(Target.Row, "C")) = "S" Then
Cells(Target.Row, "F") = Cells(Target.Row, "D") * Cells(Target.Row, "E")
Cells(Target.Row, "G") = 0
ElseIf UCase(Cells(Target.Row, "C")) = "A" Then
Cells(Target.Row, "G") = Cells(Target.Row, "D") * Cells(Target.Row, "E")
Cells(Target.Row, "F") = 0
End If
Son:
End Sub
bu kodda c sütununa s yazarsam d ve e yi carpıp f ye yazıyor a yazarsamda dyi ve e yi carpıp g ye yazıyor ancak c deki değişiklikleri algılamıyor
yani örnek:c7 ye s yazdım d7 ve e7 carptı sonucu f ye yazdı ama c7 deki s yi siler veya değiştirisem carpım sonucu gene f de kalıyor bunu silmesi gerekli
nasıl yapabilirim
saygılar
