• DİKKAT

    DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
    Altın Üyelik Hakkında Bilgi

Bulunamadı Mesajı Versin

Katılım
3 Mart 2006
Mesajlar
28
CommandButton1 ' e atanan aşağıdaki kodların neresine "Aranan veri Bulunamadı" mesajı veren kodu eklemek lazım.Saygılarımla


Private Sub CommandButton1_Click()
ListBox1.Clear
If cbadısoyadı.Text = "" Then Exit Sub
If CheckBox1.Value = True Then look = 1 Else look = 2
If CheckBox3.Value = True Then bas = 1 Else bas = 2
Set c = Range("e:e").Find(cbadısoyadı, LookIn:=xlValues, MatchCase:=CheckBox2.Value, _
LookAt:=look, SearchDirection:=bas)

If Not c Is Nothing Then
firstAddress = c.Address
ListBox1.AddItem
ListBox1.List(0, 0) = c.Address
ListBox1.List(0, 1) = c
basla:
Set c = Range("e:e").FindNext(c)
If Not c Is Nothing And c.Address <> firstAddress Then
a = a + 1
ListBox1.AddItem
ListBox1.List(a, 0) = c.Address
ListBox1.List(a, 1) = c
GoTo basla
End If
End If

If CheckBox4.Value = 0 Then Exit Sub
If ListBox1.ListCount > 0 Then
For X = 0 To ListBox1.ListCount - 2
For Y = X + 1 To ListBox1.ListCount - 1
If Val(Replace(ListBox1.List(X, 0), "$A$", "")) > Val(Replace(ListBox1.List _
(Y, 0), "$A$", "")) Then Call swap(X, Y)
Next Y, X
End If
End Sub
 
Aşağıdaki mavi renkli satırları ilave edebilirsiniz.

Kod:
Private Sub CommandButton1_Click()
ListBox1.Clear
If cbadısoyadı.Text = "" Then Exit Sub
If CheckBox1.Value = True Then look = 1 Else look = 2
If CheckBox3.Value = True Then bas = 1 Else bas = 2
 
[B][COLOR=blue]if worksheetfunction.countif([e:e],cbadısoyadı)=0 then[/COLOR][/B]
[B][COLOR=blue]msgbox "Aranan veri bulunamadı."[/COLOR][/B]
[B][COLOR=blue]exit sub[/COLOR][/B]
[B][COLOR=blue]end if[/COLOR][/B]
 
Set c = Range("e:e").Find(cbadısoyadı, LookIn:=xlValues, MatchCase:=CheckBox2.Value, _
LookAt:=look, SearchDirection:=bas)
 
If Not c Is Nothing Then
firstAddress = c.Address
ListBox1.AddItem
ListBox1.List(0, 0) = c.Address
ListBox1.List(0, 1) = c
basla:
Set c = Range("e:e").FindNext(c)
If Not c Is Nothing And c.Address <> firstAddress Then
a = a + 1
ListBox1.AddItem
ListBox1.List(a, 0) = c.Address
ListBox1.List(a, 1) = c
GoTo basla
End If
End If
 
If CheckBox4.Value = 0 Then Exit Sub
If ListBox1.ListCount > 0 Then
For X = 0 To ListBox1.ListCount - 2
For Y = X + 1 To ListBox1.ListCount - 1
If Val(Replace(ListBox1.List(X, 0), "$A$", "")) > Val(Replace(ListBox1.List _
(Y, 0), "$A$", "")) Then Call swap(X, Y)
Next Y, X
End If
End Sub
 
Mesajla ilgili kod bul işlevini bozuyor.

Sayın Leventm öncelikle teşekkür ederim.Ancak kodlarınız bul komutu işlevini bozuyor.Dosyayı ekte gönderiyorum.Yardımcı olursanız memnun olurum.Selamlarımla.
 
Sorun Çözüldü

Sayın Leventm sorunu hallettim,bir başkasına lazım olur diye paylaşmak istedim.Selamlarımla

Private Sub CommandButton1_Click()
ListBox1.Clear
If cbadısoyadı.Text = "" Then Exit Sub
If CheckBox1.Value = True Then look = 1 Else look = 2
If CheckBox3.Value = True Then bas = 1 Else bas = 2
Set c = Range("e:e").Find(cbadısoyadı, LookIn:=xlValues, MatchCase:=CheckBox2.Value, _
LookAt:=look, SearchDirection:=bas)
If Not c Is Nothing Then

Else
MsgBox”Aranan Veri Bulunamadı”
End If

firstAddress = c.Address
ListBox1.AddItem
ListBox1.List(0, 0) = c.Address
ListBox1.List(0, 1) = c
basla:
Set c = Range("e:e").FindNext(c)
If Not c Is Nothing And c.Address <> firstAddress Then
a = a + 1
ListBox1.AddItem
ListBox1.List(a, 0) = c.Address
ListBox1.List(a, 1) = c
GoTo basla
’End If(çıkarıldı)
End If

If CheckBox4.Value = 0 Then Exit Sub
If ListBox1.ListCount > 0 Then
For X = 0 To ListBox1.ListCount - 2
For Y = X + 1 To ListBox1.ListCount - 1
If Val(Replace(ListBox1.List(X, 0), "$A$", "")) > Val(Replace(ListBox1.List _
(Y, 0), "$A$", "")) Then Call swap(X, Y)
Next Y, X
End If
End Sub
 
Geri
Üst