Listboxda bir sonraki yada bir önceki satır

Katılım
18 Mart 2005
Mesajlar
63
Excel Vers. ve Dili
office2007 türkçe
bir buton yardımıyla listboxta bir önceki yada bir sonraki satıra nasıl geçerim.
 

Levent Menteşoğlu

Administrator
Yönetici
Admin
Katılım
13 Ekim 2004
Mesajlar
16,056
Excel Vers. ve Dili
Excel 2010-32 bit-Türkçe
Excel 365 -32 bit-Türkçe
Bir sonraki satır için;

Kod:
If ListBox1.ListIndex < ListBox1.ListCount - 1 Then ListBox1.ListIndex = ListBox1.ListIndex + 1
Bir önceki satır için;

Kod:
If ListBox1.ListIndex > 0 Then ListBox1.ListIndex = ListBox1.ListIndex - 1
 
Katılım
18 Mart 2005
Mesajlar
63
Excel Vers. ve Dili
office2007 türkçe
Olmadı

Alakanıza teşekkür ederim.

Private Sub CommandButton2_Click()
If UserForm3.ListBox1.ListIndex < ListBox1.ListCount - 1 Then
UserForm3.ListBox1.ListIndex = UserForm3.ListBox1.ListIndex + 1
End If
End Sub

kodu bu biçimiyle yazdım ama iş görmedi.

Userform4 te userform3.listboxtaki veriler görüntüleniyor. Bu verileri userform3 e dönmeden form4 üzerindeki bir butonla aşağı yukarı gezmek istiyorum ama olmuyor.

dosyaya linkten ulaşabilirsiniz.



http://rapidshare.com/files/23147827/Goezlem_Defteri.rar.html
 

Levent Menteşoğlu

Administrator
Yönetici
Admin
Katılım
13 Ekim 2004
Mesajlar
16,056
Excel Vers. ve Dili
Excel 2010-32 bit-Türkçe
Excel 365 -32 bit-Türkçe
Aşağıdaki kodları deneyin.

Kod:
Private Sub CommandButton2_Click()
If UserForm3.ListBox1.ListIndex < UserForm3.ListBox1.ListCount - 1 Then
UserForm3.ListBox1.ListIndex = UserForm3.ListBox1.ListIndex + 1
End If
UserForm_Initialize
End Sub
 
Private Sub CommandButton3_Click()
If UserForm3.ListBox1.ListIndex < UserForm3.ListBox1.ListCount - 1 Then
UserForm3.ListBox1.ListIndex = UserForm3.ListBox1.ListIndex - 1
End If
UserForm_Initialize
End Sub
 
Katılım
18 Mart 2005
Mesajlar
63
Excel Vers. ve Dili
office2007 türkçe
Teşekkür.

Kod çalışıyor. Çok teşekkür ederim.
 
Üst