DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Private Sub Worksheet_Change(ByVal Target As Range)
Dim deg, c As Range
If Intersect(Target, [A:A]) Is Nothing Then Exit Sub
With Target
If .Row < 3 Then Exit Sub
If .Count > 1 Then Exit Sub
If .Value = "" Then Exit Sub
If WorksheetFunction.CountIf(Range("A3:A" & Rows.Count), .Value) > 1 Then
MsgBox "Bu veri daha önce girilmiş"
deg = .Value
.ClearContents
Set c = Range("A3:A" & Rows.Count).Find(deg, , xlValues, xlWhole)
If Not c Is Nothing Then
c.Select
End If
End If
End With
End Sub
Tekrar edileni yazmak yada yazmamak benim elimde olamaz mı?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim alan As Range, c As Range, Adr As String, renk
Set alan = Range("A3:A" & Rows.Count)
If Intersect(Target, alan) Is Nothing Then Exit Sub
With Target
If .Count > 1 Then Exit Sub
If .Value = "" Then Exit Sub
If WorksheetFunction.CountIf(alan, .Value) > 1 Then
Set c = alan.Find(.Value, , xlValues, xlWhole)
If Not c Is Nothing Then
Adr = c.Address
Do
If c.Address <> .Address Then
renk = c.Interior.ColorIndex
c.Select
c.Interior.ColorIndex = 3
If MsgBox("Bu veri daha önce girilmiş" & Chr(10) & _
"Devam edeyim mi?", vbInformation + vbYesNo, "Bilgi") = vbYes Then
.Select
c.Interior.ColorIndex = renk
Exit Sub
Else
c.Interior.ColorIndex = renk
.ClearContents
.Select
Exit Sub
End If
End If
Set c = alan.FindNext(c)
Loop While Not c Is Nothing And c.Address <> Adr
End If
End If
End With
End Sub