- Katılım
- 10 Ekim 2010
- Mesajlar
- 1,469
- Excel Vers. ve Dili
- 2010 Türkçe
Merhaba, Aşağıda 3 farklı işlemlerde kullandığım aynı olayla çalışan kod var, kodların çalışmasında sıkıntı yok ama 3 aynı sayfada olunca kodların biri çalışsa diğeri, diğeri çalışsa öteki diğeri çalışmıyor. Yerlerini değiştiriyorum olmuyor. Bu üç kodun çalışması gerekiyor. Ne yapmamız gerekiyor acaba.
Kod:
Private Sub Worksheet_Change(ByVal Target As Range)
'Listeyi gösterir
Dim Bul As Range, S2 As Worksheet, Adres As String
If Intersect(Target, Range("A3:A" & Rows.Count, "C3:C" & Rows.Count)) Is Nothing Then Exit Sub
Cells(Target.Row, "M").Clear
If Cells(Target.Row, "A") <> "" And Cells(Target.Row, "C") <> "" Then
Set S2 = Sheets("GÖNDERİLENLER")
Set Bul = S2.Range("A:A").Find(Cells(Target.Row, "C"), , , xlWhole)
If Not Bul Is Nothing Then
Adres = Bul.Address
Do
If Bul.Offset(0, 5) = Cells(Target.Row, "A") Then
With Cells(Target.Row, "M")
.Value = "Lİsteye Git"
.Font.Bold = True
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Font.ColorIndex = 1
End With
Exit Do
End If
Set Bul = S2.Range("A:A").FindNext(Bul)
Loop While Not Bul Is Nothing And Bul.Address <> Adres
End If
End If
'B sütuna veri yazıldında A sütuna tarihi atar
If Intersect(Target, [B:B]) Is Nothing Then Exit Sub
If Target.Row < 3 Then Exit Sub
If Target <> "" Then Target.Offset(0, -1) = Date
'H sütuna sonuçları verir
If Intersect(Target, Range("D3:G" & Rows.Count)) Is Nothing Then Exit Sub
On Error Resume Next
Cells(Target.Row, "H") = "=IF(COUNTA(RC[-4]:RC[-1])=0,"""",RC[-4]*RC[-3]/100+IF(AND(RC[-2]<>0,RC[-1]<>0),(RC[-2]*MID(RC[-1],1,2)*MID(RC[-1],4,2))/15000,0))"
Cells(Target.Row, "H") = Cells(Target.Row, "H")
End Sub
