userformda 31 tane textbox var ama calıstırınca 21.textboxdan sonra hata veriyo sadece 20 ye kadar calısıyor neden acabaa ?

Cengizhantr06

Altın Üye
Katılım
16 Mayıs 2020
Mesajlar
327
Excel Vers. ve Dili
Office 365 Türkçe
Altın Üyelik Bitiş Tarihi
18-05-2025
Private Sub ListBox1_Click()
If Not ListBox1.ListIndex = -1 Then
TextBox1.Value = ListBox1.List(ListBox1.ListIndex, 1)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox2.Value = ListBox1.List(ListBox1.ListIndex, 2)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox3.Value = ListBox1.List(ListBox1.ListIndex, 3)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox4.Value = ListBox1.List(ListBox1.ListIndex, 4)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox5.Value = ListBox1.List(ListBox1.ListIndex, 5)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox6.Value = ListBox1.List(ListBox1.ListIndex, 6)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox7.Value = ListBox1.List(ListBox1.ListIndex, 7)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox8.Value = ListBox1.List(ListBox1.ListIndex, 8)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox9.Value = ListBox1.List(ListBox1.ListIndex, 9)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox10.Value = ListBox1.List(ListBox1.ListIndex, 10)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox11.Value = ListBox1.List(ListBox1.ListIndex, 11)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox12.Value = ListBox1.List(ListBox1.ListIndex, 12)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox13.Value = ListBox1.List(ListBox1.ListIndex, 13)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox14.Value = ListBox1.List(ListBox1.ListIndex, 14)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox15.Value = ListBox1.List(ListBox1.ListIndex, 15)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox16.Value = ListBox1.List(ListBox1.ListIndex, 16)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox17.Value = ListBox1.List(ListBox1.ListIndex, 17)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox18.Value = ListBox1.List(ListBox1.ListIndex, 18)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox19.Value = ListBox1.List(ListBox1.ListIndex, 19)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox20.Value = ListBox1.List(ListBox1.ListIndex, 20)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox21.Value = ListBox1.List(ListBox1.ListIndex, 21)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox22.Value = ListBox1.List(ListBox1.ListIndex, 22)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox23.Value = ListBox1.List(ListBox1.ListIndex, 23)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox24.Value = ListBox1.List(ListBox1.ListIndex, 24)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox25.Value = ListBox1.List(ListBox1.ListIndex, 25)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox26.Value = ListBox1.List(ListBox1.ListIndex, 26)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox27.Value = ListBox1.List(ListBox1.ListIndex, 27)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox28.Value = ListBox1.List(ListBox1.ListIndex, 28)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox29.Value = ListBox1.List(ListBox1.ListIndex, 29)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox30.Value = ListBox1.List(ListBox1.ListIndex, 30)
End If
If Not ListBox1.ListIndex = -1 Then
TextBox31.Value = ListBox1.List(ListBox1.ListIndex, 31)
End If
End Sub


userformda 31 tane textbox var ama calıstırınca 21.textboxdan sonra hata veriyo sadece 20 ye kadar calısıyor neden acabaa ?
 

Emir Hüseyin Çoban

Destek Ekibi
Destek Ekibi
Katılım
11 Ağustos 2008
Mesajlar
5,892
Excel Vers. ve Dili
Office 2013 Tr - Win10 x64
.

Hata aldığınız dosyanın örneği ile görmek daha iyi olur.

.
 

ÖmerFaruk

Destek Ekibi
Destek Ekibi
Katılım
22 Ekim 2017
Mesajlar
4,784
Excel Vers. ve Dili
Microsoft 365 Tr-64
ListBox Kolon sayınız doğru mu?
 

Cengizhantr06

Altın Üye
Katılım
16 Mayıs 2020
Mesajlar
327
Excel Vers. ve Dili
Office 365 Türkçe
Altın Üyelik Bitiş Tarihi
18-05-2025
kullanıcı adı admin şifre yok TAKİP adlı userformda hata
 

Ekli dosyalar

ÖmerFaruk

Destek Ekibi
Destek Ekibi
Katılım
22 Ekim 2017
Mesajlar
4,784
Excel Vers. ve Dili
Microsoft 365 Tr-64
C++:
Private Sub UserForm_Initialize()
ListBox1.RowSource = "10_Günlük_Rapor!A5:U32"
ComboBox1.RowSource = "10_Günlük_Rapor!A5:U32"
ComboBox1.ColumnCount = 1
ListBox1.ColumnCount = 1
Kodlarınız böyle başlıyor. RowSource kısmında A-U sütunlarında işlem yapıyor ancak combobox ve listbox kolon sayısını 1 diyorsunuz. Sanki 21 olmalı.
 

Cengizhantr06

Altın Üye
Katılım
16 Mayıs 2020
Mesajlar
327
Excel Vers. ve Dili
Office 365 Türkçe
Altın Üyelik Bitiş Tarihi
18-05-2025
C++:
Private Sub UserForm_Initialize()
ListBox1.RowSource = "10_Günlük_Rapor!A5:U32"
ComboBox1.RowSource = "10_Günlük_Rapor!A5:U32"
ComboBox1.ColumnCount = 1
ListBox1.ColumnCount = 1
Kodlarınız böyle başlıyor. RowSource kısmında A-U sütunlarında işlem yapıyor ancak combobox ve listbox kolon sayısını 1 diyorsunuz. Sanki 21 olmalı.
Öle deneyim birde
 

ÖmerFaruk

Destek Ekibi
Destek Ekibi
Katılım
22 Ekim 2017
Mesajlar
4,784
Excel Vers. ve Dili
Microsoft 365 Tr-64
1. ListBox Satır ve Sütun sayıları SIFIRDAN başlar
2. Siz RowSource ile 21 sütun alıyorsunuz. Haliyle 0 dan başlayınca 20.kolona denk gelir.
3. O textBoxdan sonra bir sonraki de hata verecektir.
4. TextBox sayınız ListBox kolon sayısıyla (sıfıra dikkat) aynı olmalı
 

Cengizhantr06

Altın Üye
Katılım
16 Mayıs 2020
Mesajlar
327
Excel Vers. ve Dili
Office 365 Türkçe
Altın Üyelik Bitiş Tarihi
18-05-2025
1. ListBox Satır ve Sütun sayıları SIFIRDAN başlar
2. Siz RowSource ile 21 sütun alıyorsunuz. Haliyle 0 dan başlayınca 20.kolona denk gelir.
3. O textBoxdan sonra bir sonraki de hata verecektir.
4. TextBox sayınız ListBox kolon sayısıyla (sıfıra dikkat) aynı olmalı
Yapamadım
 

ÖmerFaruk

Destek Ekibi
Destek Ekibi
Katılım
22 Ekim 2017
Mesajlar
4,784
Excel Vers. ve Dili
Microsoft 365 Tr-64
Listbox Click kodunuzu aşağıdakiyle değiştirin
C++:
Private Sub ListBox1_Click()
If Not ListBox1.ListIndex = -1 Then
    For i = 1 To 31
        Controls("TextBox" & i).Value = ListBox1.List(ListBox1.ListIndex, i - 1)
    Next i
End If
Initialize kodunuzun da baş kısmını değiştirin
C++:
Private Sub UserForm_Initialize()
ListBox1.RowSource = "10_Günlük_Rapor!A5:AF32"

Label1.Caption = Format(Now - 15, "dddd d mmmm yyyy hh:mm:ss ")
' Label1 den itibaren aşağısı aynı kalsın'
 

Cengizhantr06

Altın Üye
Katılım
16 Mayıs 2020
Mesajlar
327
Excel Vers. ve Dili
Office 365 Türkçe
Altın Üyelik Bitiş Tarihi
18-05-2025
Listbox Click kodunuzu aşağıdakiyle değiştirin
C++:
Private Sub ListBox1_Click()
If Not ListBox1.ListIndex = -1 Then
    For i = 1 To 31
        Controls("TextBox" & i).Value = ListBox1.List(ListBox1.ListIndex, i - 1)
    Next i
End If
Initialize kodunuzun da baş kısmını değiştirin
C++:
Private Sub UserForm_Initialize()
ListBox1.RowSource = "10_Günlük_Rapor!A5:AF32"

Label1.Caption = Format(Now - 15, "dddd d mmmm yyyy hh:mm:ss ")
' Label1 den itibaren aşağısı aynı kalsın'
çok güzel oldu çok çok tşk ederim sağolun :)
 
Üst