- Katılım
- 6 Kasım 2005
- Mesajlar
- 300
- Altın Üyelik Bitiş Tarihi
- 06-09-2023
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
' If Intersect(Target, [b2:b65536]) Is Nothing Then Exit Sub
If Intersect(Target, [b2:b65536, c:c]) Is Nothing Then Exit Sub
with target
if .Column = 2 then
say = WorksheetFunction.CountIf(Range("b1:b" & .Row - 1), Target)
If say > 0 Then
MsgBox "Numara Mevcuttur...Çift Girişe Onay Verilmez..."
.Select
.value = empty
End If
elseif .Column = 3 then
' If Intersect(Target, [c:c]) Is Nothing Then Exit Sub
satır = "h" & .Row & ":a" & .Row
Select Case Target
Case "BEKLEMEDE": Range(satır).Font.ColorIndex = 5
End Select
end if
end with
End Sub
aşağıdaki kodu yukarıdaki koda nasıl entegre edebilirim...her ikisini birden yazdığımda hata veriyor...
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Aralik As Range, ilk As Range
Set Aralik = Range("b1:b100")
Application.EnableEvents = False
For Each ilk In Range(Target.Address)
If Not Intersect(ilk, Aralik) Is Nothing Then ilk.Offset(0, -1) = Date
Next ilk
Application.EnableEvents = True
Set Aralik = Nothing
End Sub
On Error Resume Next
' If Intersect(Target, [b2:b65536]) Is Nothing Then Exit Sub
If Intersect(Target, [b2:b65536, c:c]) Is Nothing Then Exit Sub
with target
if .Column = 2 then
say = WorksheetFunction.CountIf(Range("b1:b" & .Row - 1), Target)
If say > 0 Then
MsgBox "Numara Mevcuttur...Çift Girişe Onay Verilmez..."
.Select
.value = empty
End If
elseif .Column = 3 then
' If Intersect(Target, [c:c]) Is Nothing Then Exit Sub
satır = "h" & .Row & ":a" & .Row
Select Case Target
Case "BEKLEMEDE": Range(satır).Font.ColorIndex = 5
End Select
end if
end with
End Sub
aşağıdaki kodu yukarıdaki koda nasıl entegre edebilirim...her ikisini birden yazdığımda hata veriyor...
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
Dim Aralik As Range, ilk As Range
Set Aralik = Range("b1:b100")
Application.EnableEvents = False
For Each ilk In Range(Target.Address)
If Not Intersect(ilk, Aralik) Is Nothing Then ilk.Offset(0, -1) = Date
Next ilk
Application.EnableEvents = True
Set Aralik = Nothing
End Sub