- Katılım
- 16 Kasım 2008
- Mesajlar
- 4
- Excel Vers. ve Dili
- excel2003
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Ustalarım ekteki dosyadaki gibi bir liste yapacağım ama arama kısmını yapamıyorum yardımcı olabilirmisiniz?
Sub arabul()
Set Sh1 = Sheets("Sayfa1")
Dim aranan As String
Dim Rng As Range
aranan = Sh1.TextBox1.Text
If Trim(aranan) <> "" Then
With Sh1.Range("c6:d65000")
Set Rng = .Find(What:=aranan, After:=.Cells(1), LookIn:=xlValues, lookat:=xlWhole, _
SearchOrder:=xlByRows, SearchDirection:=xlPrevious, MatchCase:=False)
If Not Rng Is Nothing Then
Sh1.Cells(3, "b") = Sh1.Cells(Rng.Row, "b")
Sh1.Cells(3, "c") = Sh1.Cells(Rng.Row, "c")
Sh1.Cells(3, "d") = Sh1.Cells(Rng.Row, "d")
Sh1.Cells(3, "e") = Sh1.Cells(Rng.Row, "e")
Exit Sub
Else
MsgBox "Sonuç yok"
End If
End With
End If
End Sub
Bu kodu denermisiniz.
Kod:Sub arabul() Set Sh1 = Sheets("Sayfa1") Dim aranan As String Dim Rng As Range aranan = Sh1.TextBox1.Text If Trim(aranan) <> "" Then With Sh1.Range("c6:d65000") Set Rng = .Find(What:=aranan, After:=.Cells(1), LookIn:=xlValues, lookat:=xlWhole, _ SearchOrder:=xlByRows, SearchDirection:=xlPrevious, MatchCase:=False) If Not Rng Is Nothing Then Sh1.Cells(3, "b") = Sh1.Cells(Rng.Row, "b") Sh1.Cells(3, "c") = Sh1.Cells(Rng.Row, "c") Sh1.Cells(3, "d") = Sh1.Cells(Rng.Row, "d") Sh1.Cells(3, "e") = Sh1.Cells(Rng.Row, "e") Exit Sub Else MsgBox "Sonuç yok" End If End With End If End Sub
Ekli dosyanızı kontrol ediniz.