Alttaki kodu deneyin abey.YENİ CARİ sayfasına eklenecek kod.
Dim bul As Range, kacinci As Long
Private Sub Worksheet_Change(ByVal Target As Range)
Dim satir As Long, sutun As Byte, aranan, hedefsutun As String
kacinci = 1
If Not Intersect(Target, Range("B2:B1048576,F2:F1048576,R2:R1048576")) Is Nothing Then
Select Case Target.Column
Case 2: satir = Target.Row: sutun = Target.Column: aranan = Target.Value: hedefsutun = "B:B"
Case 6: satir = Target.Row: sutun = Target.Column: aranan = Target.Value: hedefsutun = "i:i"
Case 18: satir = Target.Row: sutun = Target.Column: aranan = Target.Value: hedefsutun = "H:H"
End Select
varmi sutun, hedefsutun, satir, sutun, aranan
End If
End Sub
Function varmi(alan As Byte, aranansutun As String, satir As Long, sutun As Byte, aranan)
If satir > 1 And sutun = alan Then
If Trim(Cells(satir, sutun).Value) <> "" Then
If Cells(satir, sutun).Cells.Count = 1 Then
Set bul = Sayfa2.Range(aranansutun).Find(aranan, , , 1)
If Not bul Is Nothing Then kacinci = bul.Row
End If
End If
End If
If kacinci > 1 Then
MsgBox "ilgili veri bulundu", vbCritical, "mükerrer"
Exit Function
End If
End Function