• DİKKAT

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

listbox metni kaydır

Katılım
6 Temmuz 2008
Mesajlar
1,875
Excel Vers. ve Dili
OFFİCE 2010- TÜRKÇE
Kolay gelsin arkadaşlar;

Listboxa veri alırken o verilerin tek satırda fakat altaltaymış gibi görünmesini sağlayabilirmiyiz?


Kod:
sat = ListBox1.ListCount
sat = sat + 1
ListBox1.AddItem
ListBox1.List(sat - 1, 0) = sat & Chr(13) & "________________"
ListBox1.List(sat - 1, 1) = TextBox1.Value & Chr(13) & "________________"
ListBox1.List(sat - 1, 2) = "Adet" & Chr(13) & "________________"

Bunu yaptım ama haliyle olmadı :)
 
Son düzenleme:
Ya da alternatif olarak yaptığım kodlarda hangi satırı secersem seceyim.

O satıra ait 3 satırı birden secili hale getirip satır sil dediğimde silecek bir koda ihtiyacım var ..
Kod:
Private Sub satır_iptal_Click()
On Error Resume Next

ListBox1.RemoveItem ListBox1.ListIndex
If ListBox1.ListIndex > 0 Then ListBox1.Selected(0) = True
If ListBox1.ListIndex = 0 Then ListBox1.Selected(0) = False
End Sub



Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
On Error Resume Next
Set ür = Sheets("Ürün Listesi")
txtt = TextBox1.Value
If txtt <> "" Then
If WorksheetFunction.CountIf(ür.Range("A1:A65536"), txtt) <> 0 Then

If IsNumeric(txtt) = True Then txtt = txtt * 1
m_adi = WorksheetFunction.Match(txtt, ür.Range("A2:A65536"), 0) + 1


sat = ListBox1.ListCount
sat = sat + 1
ListBox1.AddItem
ListBox1.List(sat - 1, 0) = sat / 3 + 1
ListBox1.List(sat - 1, 1) = TextBox1.Value
ListBox1.List(sat - 1, 2) = "Adet"


ListBox1.AddItem
ListBox1.List(sat, 1) = ür.Cells(m_adi, "B")

ListBox1.AddItem
ListBox1.List(sat + 1, 0) = "-----------------"
ListBox1.List(sat + 1, 1) = "---------------------------------------------------------"
ListBox1.List(sat + 1, 2) = "-----------------"



Cancel = True
Me.TextBox1 = ""
     Me.TextBox1.SetFocus
 
         
          Else
          MsgBox "Ürün Bulunamadı"
         TextBox1.SetFocus
     
         Cancel = True
          Me.TextBox1 = ""
           End If
               End If
End Sub
 

Ekli dosyalar

  • LİSTBOX.jpg
    LİSTBOX.jpg
    48.8 KB · Görüntüleme: 4
Geri
Üst