Listbox Üzerinde Veri Bulma ve Çoklu Silme

Katılım
18 Kasım 2012
Mesajlar
423
Excel Vers. ve Dili
Microsoft Office 365
Altın Üyelik Bitiş Tarihi
04-07-2024
Merhaba,

Öncelikle herkese iyi çalışmalar dilerim. Amatör olarak oluşturmuş olduğum bir listbox içerisinde bir sütuna yönelik aranan bir değeri dosya içerisinde bularak bir buton ile listbox üzerinde siliyorum. Ancak aşağıda oluşturmuş olduğum kodlar çokta kullanışlı olmadı.

Asıl yapmak istediğim;

1-Aramaları tüm sütunlara yönelik yapmak,
2-Doya değil listbox üzerinde bulmak,
3-Satırları tek tek yada toplu olarak bir buton ile silebilmek.

Bu konuda bana yardımcı olabilecek arkadaşlardan rica ediyorum. Yardımlarınız için şimdiden teşekkür ederim.

Syg,



Kod:
Private Sub CommandButton2_search_Click()

On Error GoTo bitir


aranan = InputBox("Please enter invoice number you would like to search !", "SEARCH SHEET")

Range("J:J").Find(aranan).Select

sil_satir = ActiveCell.Row

ComboBox1ACREG.Value = Worksheets("DATA").Cells(sil_satir, 2)
TextBox1FLIGHTN.Value = Worksheets("DATA").Cells(sil_satir, 4)
TextBox2FLIGHTDATE.Value = Worksheets("DATA").Cells(sil_satir, 5)
TextBox3FLIGHTROUTE.Value = Worksheets("DATA").Cells(sil_satir, 6)
TextBox4ICAO.Value = Worksheets("DATA").Cells(sil_satir, 7)
TextBox5COMPANY.Value = Worksheets("DATA").Cells(sil_satir, 9)
TextBox6INVOICENO.Value = Worksheets("DATA").Cells(sil_satir, 10)
TextBox7INVOICEDATE.Value = Worksheets("DATA").Cells(sil_satir, 11)
ComboBox2SERVICE.Value = Worksheets("DATA").Cells(sil_satir, 12)
ComboBox3SERVICETYPE.Value = Worksheets("DATA").Cells(sil_satir, 13)
TextBox8DESCRIPTION.Value = Worksheets("DATA").Cells(sil_satir, 14)
TextBox9QUANTITY.Value = Worksheets("DATA").Cells(sil_satir, 15)
TextBox10UNITPRICE.Value = Worksheets("DATA").Cells(sil_satir, 16)
TextBox12DISBURSEMENT.Value = Worksheets("DATA").Cells(sil_satir, 18)
TextBox13DISBURSEMENTTAX.Value = Worksheets("DATA").Cells(sil_satir, 19)
TextBox14INVOICETAX.Value = Worksheets("DATA").Cells(sil_satir, 20)
ComboBox4CURRENCY.Value = Worksheets("DATA").Cells(sil_satir, 22)
TextBox15DESCRIPTIONS.Value = Worksheets("DATA").Cells(sil_satir, 23)


Exit Sub
bitir:    MsgBox "Searching invoice is not found !", , "WARNING"
temizle
End Sub
Sub temizle()
For Each nesne In UserForm1.Controls
ad = nesne.Name
soldan = Left(ad, 7)
    If soldan = "TextBox" Then
        nesne.Value = ""
    End If
Next
End Sub


Private Sub CommandButton3_delete_Click()

If TextBox6INVOICENO.Value <> "" Then

Rows(ActiveCell.Row).Delete


ComboBox1ACREG.Value = " "
TextBox1FLIGHTN.Value = " "
TextBox2FLIGHTDATE.Value = " "
TextBox3FLIGHTROUTE.Value = " "
TextBox4ICAO.Value = " "
TextBox5COMPANY.Value = " "
TextBox6INVOICENO.Value = " "
TextBox7INVOICEDATE.Value = " "
ComboBox2SERVICE.Value = " "
ComboBox3SERVICETYPE.Value = " "
TextBox8DESCRIPTION.Value = " "
TextBox9QUANTITY.Value = " "
TextBox10UNITPRICE.Value = " "
TextBox12DISBURSEMENT.Value = " "
TextBox13DISBURSEMENTTAX.Value = " "
TextBox14INVOICETAX.Value = " "
ComboBox4CURRENCY.Value = " "
TextBox15DESCRIPTIONS.Value = " "

Else

MsgBox "You should first complete searching process !"
End If


End Sub
 
Son düzenleme:
Üst