- Katılım
- 8 Mart 2009
- Mesajlar
- 504
- Excel Vers. ve Dili
- 2010
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim BUL As Range, ADRES As String
If Intersect(Target, Range("C7:C65536,G7:G65536")) Is Nothing Then Exit Sub
If Target = "" Then Exit Sub
Set BUL = Range("C7:C" & Target.Row - 1).Find(Cells(Target.Row, "C"), LookAt:=xlWhole)
If Not BUL Is Nothing Then
ADRES = BUL.Address
Do
If Cells(BUL.Row, "G") = Cells(Target.Row, "G") Then
MsgBox "Bu kayıt daha önce " & BUL.Row & " satırında girilmiştir !", vbCritical, "Dikkat !"
Cells(Target.Row, "C") = ""
Cells(Target.Row, "G") = ""
Cells(Target.Row, "C").Select
Exit Do
End If
Set BUL = Range("C7:C" & Target.Row - 1).FindNext(BUL)
Loop While Not BUL Is Nothing And BUL.Address <> ADRES
End If
End Sub
Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ARALIK As Range, BUL As Range, ADRES As String
If Intersect(Target, Range("C7:C65536,G7:G65536,E3:E65536")) Is Nothing Then Exit Sub
If Target.Count > 1 Then Exit Sub
If Target = "" Then Exit Sub
If Target.Column = 3 Or Target.Column = 7 Then
Set BUL = Range("C7:C" & Target.Row - 1).Find(Cells(Target.Row, "C"), LookAt:=xlWhole)
If Not BUL Is Nothing Then
ADRES = BUL.Address
Do
If Cells(BUL.Row, "G") = Cells(Target.Row, "G") Then
MsgBox "Bu kayıt daha önce " & BUL.Row & " satırında girilmiştir !", vbCritical, "Dikkat !"
Cells(Target.Row, "C") = ""
Cells(Target.Row, "G") = ""
Cells(Target.Row, "C").Select
Exit Do
End If
Set BUL = Range("C7:C" & Target.Row - 1).FindNext(BUL)
Loop While Not BUL Is Nothing And BUL.Address <> ADRES
End If
Else
Set ARALIK = Range("D39000:D65536")
Set BUL = ARALIK.Find(Target, LookAt:=xlWhole)
If Not BUL Is Nothing Then
Application.EnableEvents = False
ADRES = BUL.Address
Do
Target.Offset(0, -1) = Cells(BUL.Row, "E")
Set BUL = ARALIK.FindNext(BUL)
Loop While Not BUL Is Nothing And BUL.Address <> ADRES
Application.EnableEvents = True
End If
End If
Set ARALIK = Nothing
Set BUL = Nothing
End Sub