İyi Günler;
Aşağıdaki kodla B4 hücresinde bulunan dosya nosu ile dosyaya ait bilgileri çekiyorum. Ancak, bazen dosya numarası bulunması halinde Aradığınız dosya bulunmadı mesajı vermekte. Verileri çekememekteyim. Neden olabilir.
Hücre Biçimlendirmesi => Metin
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Intersect(Target, [B4]) Is Nothing Then Exit Sub
If Target.Value = Empty Then Exit Sub
Set S1 = Sheets("geneltoplam")
Set S2 = Sheets("liste")
For Each bul In S2.Range("B5:B1000")
If bul = Target.Value Then sat = bul.Row
Next
If sat = "" Then
MsgBox "ARADIĞINIZ DOSYA BULUNAMADI.", vbInformation, "Bilgi"
Exit Sub
End If
S1.Cells(7, "b").Value = S2.Cells(sat, "C").Value
S1.Cells(8, "b").Value = S2.Cells(sat, "D").Value
S1.Cells(5, "d").Value = S2.Cells(sat, "G").Value
S1.Cells(9, "d").Value = S2.Cells(sat, "E").Value
S1.Cells(10, "d").Value = S2.Cells(sat, "F").Value
S1.Cells(12, "b").Value = S2.Cells(sat, "O").Value
S1.Cells(13, "b").Value = S2.Cells(sat, "L").Value
Set S1 = Nothing
Set S2 = Nothing
End Sub
Aşağıdaki kodla B4 hücresinde bulunan dosya nosu ile dosyaya ait bilgileri çekiyorum. Ancak, bazen dosya numarası bulunması halinde Aradığınız dosya bulunmadı mesajı vermekte. Verileri çekememekteyim. Neden olabilir.
Hücre Biçimlendirmesi => Metin
Private Sub Worksheet_Change(ByVal Target As Range)
On Error Resume Next
If Intersect(Target, [B4]) Is Nothing Then Exit Sub
If Target.Value = Empty Then Exit Sub
Set S1 = Sheets("geneltoplam")
Set S2 = Sheets("liste")
For Each bul In S2.Range("B5:B1000")
If bul = Target.Value Then sat = bul.Row
Next
If sat = "" Then
MsgBox "ARADIĞINIZ DOSYA BULUNAMADI.", vbInformation, "Bilgi"
Exit Sub
End If
S1.Cells(7, "b").Value = S2.Cells(sat, "C").Value
S1.Cells(8, "b").Value = S2.Cells(sat, "D").Value
S1.Cells(5, "d").Value = S2.Cells(sat, "G").Value
S1.Cells(9, "d").Value = S2.Cells(sat, "E").Value
S1.Cells(10, "d").Value = S2.Cells(sat, "F").Value
S1.Cells(12, "b").Value = S2.Cells(sat, "O").Value
S1.Cells(13, "b").Value = S2.Cells(sat, "L").Value
Set S1 = Nothing
Set S2 = Nothing
End Sub
