Tevfik_Kursun
Altın Üye
- Katılım
- 30 Temmuz 2012
- Mesajlar
- 3,604
- Excel Vers. ve Dili
- Office 2016 Pro - Türkçe 64 Bit
- Altın Üyelik Bitiş Tarihi
- 12-02-2029
Merhaba Arkadaşlar,
Bu haliyle N2 de otomatik çalışıyor.
Bu haliyle N2 de değişiklik yapıp makroyu çalıştırınca Object Required diye hata veriyor.
Bu hata nasıl önlenebilir?
Saygılarımla
Kod:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Text = "" Or Selection.Count > 1 Then Exit Sub
If Not Intersect(Target, [N2]) Is Nothing Then
son = WorksheetFunction.Max(Cells(Rows.Count, "D").End(3).Row, 5)
eski = WorksheetFunction.Max(Cells(Rows.Count, "O").End(3).Row, 5)
Range("O3:O52").ClearContents
For i = 2 To son
If Cells(i, "D") = Target Then
yeni = WorksheetFunction.Max(Cells(Rows.Count, "O").End(3).Row + 1, 3)
Cells(yeni, "O") = i
End If
Next
End If
End Sub
Kod:
Sub GetirYaz()
If Target.Text = "" Or Selection.Count > 1 Then Exit Sub
If Not Intersect(Target, [N2]) Is Nothing Then
son = WorksheetFunction.Max(Cells(Rows.Count, "D").End(3).Row, 5)
eski = WorksheetFunction.Max(Cells(Rows.Count, "O").End(3).Row, 5)
Range("O3:O52").ClearContents
For i = 2 To son
If Cells(i, "D") = Target Then
yeni = WorksheetFunction.Max(Cells(Rows.Count, "O").End(3).Row + 1, 3)
Cells(yeni, "O") = i
End If
Next
End If
End Sub
Bu hata nasıl önlenebilir?
Saygılarımla