Merhaba,formül sayfa geçişlerinde hata veriyor.(renklendirilmiş)
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim Bak As Byte
Dim Aylar As Variant
Dim Bul As Range
Aylar = Array("OCAK", "ŞUBAT", "MART", "NİSAN", "MAYIS", "HAZİRAN", "TEMMUZ", "AĞUSTOS", "EYLÜL", "EKİM", "KASIM", "ARALIK")
If Target.Cells.Count > 1 Then Exit Sub
For Bak = 0 To 11
If ActiveSheet.Name = Aylar(Bak) And Not Intersect(Target, Range("C6:C" & Rows.Count & ", I6:I" & Rows.Count)) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(Target.Value) Then
Target(, 0) = ""
Application.EnableEvents = True
Exit Sub
Else
With Worksheets("GİRİŞ")
Set Bul = .Range("G:G").Find(what:=Target.Value, lookat:=xlWhole)
If Bul Is Nothing Then
MsgBox "Gelir Adı: " & Target.Value & " 'GİRİŞ' sayfasında bulunamadı." & vbLf & "Lütfen kontrol ederek yeniden deneyiniz.", vbExclamation
Application.EnableEvents = True
Exit Sub
Else
Target(, 0) = .Cells(Bul.Row, "A") & .Cells(Bul.Row, "B") & .Cells(Bul.Row, "F")
Application.EnableEvents = True
Exit Sub
End If
End With
End If
End If
Next
End Sub
Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Dim Bak As Byte
Dim Aylar As Variant
Dim Bul As Range
Aylar = Array("OCAK", "ŞUBAT", "MART", "NİSAN", "MAYIS", "HAZİRAN", "TEMMUZ", "AĞUSTOS", "EYLÜL", "EKİM", "KASIM", "ARALIK")
If Target.Cells.Count > 1 Then Exit Sub
For Bak = 0 To 11
If ActiveSheet.Name = Aylar(Bak) And Not Intersect(Target, Range("C6:C" & Rows.Count & ", I6:I" & Rows.Count)) Is Nothing Then
Application.EnableEvents = False
If IsEmpty(Target.Value) Then
Target(, 0) = ""
Application.EnableEvents = True
Exit Sub
Else
With Worksheets("GİRİŞ")
Set Bul = .Range("G:G").Find(what:=Target.Value, lookat:=xlWhole)
If Bul Is Nothing Then
MsgBox "Gelir Adı: " & Target.Value & " 'GİRİŞ' sayfasında bulunamadı." & vbLf & "Lütfen kontrol ederek yeniden deneyiniz.", vbExclamation
Application.EnableEvents = True
Exit Sub
Else
Target(, 0) = .Cells(Bul.Row, "A") & .Cells(Bul.Row, "B") & .Cells(Bul.Row, "F")
Application.EnableEvents = True
Exit Sub
End If
End With
End If
End If
Next
End Sub
