listboxta kaç satır var

Katılım
20 Aralık 2006
Mesajlar
939
Excel Vers. ve Dili
türkçe
arkadaşlar
listboxta toplam kaç satır giriş yapıldıysa yani toplam kaç satır varsa
textboxta görüntülemek istiyorum
şimdiden saygılar teşekkürler
 

Orion1

Uzman
Uzman
Katılım
1 Mart 2005
Mesajlar
22,254
Excel Vers. ve Dili
Win7 Home Basic TR 64 Bit

Ofis-2010-TR 32 Bit
:cool:
Kod:
msgbox Listbox1.listcount
 
Katılım
20 Aralık 2006
Mesajlar
939
Excel Vers. ve Dili
türkçe
hocam böle değilde
textboxta göstersin istiyorum
yani kaç tane satır varsa (giriş )
yapıldıysa göstersin istiyorum
 
Katılım
20 Aralık 2006
Mesajlar
939
Excel Vers. ve Dili
türkçe
Private Sub userform_Initialize()
TextBox5 = ListBox1.ListCount

hocam bu şelilde girdim
65535 yazıyor textboxta
ve giriş oldukça değişmiyor
 

Orion1

Uzman
Uzman
Katılım
1 Mart 2005
Mesajlar
22,254
Excel Vers. ve Dili
Win7 Home Basic TR 64 Bit

Ofis-2010-TR 32 Bit
Kodu veri girişi yaptığınız nesneye en son satıra yazınız.:cool:
 
Katılım
20 Aralık 2006
Mesajlar
939
Excel Vers. ve Dili
türkçe
kodlar

Kod:
Private Sub ComboBox1_Change()
Set s1 = Sheets("ffff")
sat = ComboBox1.ListIndex + 2
TextBox1 = s1.Cells(sat, "b")
TextBox2 = s1.Cells(sat, "c")
TextBox3 = s1.Cells(sat, "d")
TextBox4 = s1.Cells(sat, "e")

End Sub

Private Sub CommandButton1_Click()
On Error Resume Next
Dim i As Integer
For i = 2 To 32000
    If (Sayfa1.Cells(i, 1) = "") Then 'yeni giriş yapan kodlar
        Sayfa1.Cells(i, 1) = ComboBox1.Text
        Sayfa1.Cells(i, 2) = TextBox1.Text
        Sayfa1.Cells(i, 3) = TextBox2.Text
        Sayfa1.Cells(i, 4) = TextBox3.Text
        Sayfa1.Cells(i, 5) = TextBox4.Text
        userform_Initialize
        CommandButton2_Click
        Exit Sub
    End If
Next i
End Sub

Private Sub CommandButton2_Click()
        ComboBox1 = ""
        TextBox1 = ""
        TextBox2 = ""
        TextBox3 = ""
        TextBox4 = ""
End Sub

Private Sub userform_Initialize()
ComboBox1.SetFocus
ComboBox1.RowSource = "ffff!a2:a65536"
ListBox1.RowSource = "ssss!a2:g65536"
    If ListBox1.ListCount > 0 Then
    For X = ListBox1.ListCount - 1 To 0 Step -1
    If Not IsEmpty(ListBox1.List(X, 0)) Then
    ListBox1.ListIndex = X
    Exit For
    End If
    Next
    End If
End Sub
hocam bu kodlarda nereye yazılacak tam kavrayamadım
 

Orion1

Uzman
Uzman
Katılım
1 Mart 2005
Mesajlar
22,254
Excel Vers. ve Dili
Win7 Home Basic TR 64 Bit

Ofis-2010-TR 32 Bit
Userformun Initialize olayındaki kodları aşağıdaki kodlarala değiştiriniz.:cool:
Kod:
Private Sub userform_Initialize()
ComboBox1.SetFocus
ComboBox1.RowSource = "ffff!a2:a" & Sheets("ffff").Cells(65536, "A").End(xlUp).Row
listbox1.RowSource = "ssss!a2:g" & Sheets("ssss").Cells(65536, "A").End(xlUp).Row
    If listbox1.ListCount > 0 Then
    For X = listbox1.ListCount - 1 To 0 Step -1
    If Not IsEmpty(listbox1.List(X, 0)) Then
    listbox1.ListIndex = X
    Exit For
    End If
    Next
    End If
    textbox1.Text = listbox1.ListCount
End Sub
 
Katılım
20 Aralık 2006
Mesajlar
939
Excel Vers. ve Dili
türkçe
hocam çok teşekkür
elinize sağlık
 
Üst