Sn:fkilic76
Hata kullandığınız kodlardan kaynaklanıyor Listbox çoğuzaman bu hataları verir.Bu hatalardan kurtulmak için RowSource özelliğini kullanman gerekiyor.Müşteride olduğum için fazla detaylı ilgilenemedim ama aşağıdaki düzenlemeler sana yol gösterecektir.
Private Sub UserForm_Initialize()
Dim sh As Worksheet
Dim i%
Set sh = Sheets("Sayfa2")
Sheets("Sayfa2").Select
Baslangic = True
With ComboBox1
.AddItem "Tümü"
For i = 2 To sh.Cells(65536, 1).End(xlUp).Row
If Application.WorksheetFunction.CountIf(sh.Range("A2:A" & i), sh.Cells(i, 1)) = 1 Then
.AddItem sh.Cells(i, 1)
End If
Next i
.ListIndex = 0
End With
With ComboBox2
.AddItem "Tümü"
For i = 2 To sh.Cells(65536, 2).End(xlUp).Row
If Application.WorksheetFunction.CountIf(sh.Range("B2:B" & i), sh.Cells(i, 2)) = 1 Then
.AddItem sh.Cells(i, 2)
End If
Next i
.ListIndex = 0
End With
ListBox1.Clear
With ListBox1
.ColumnCount = 18 '*********************************burayı değiştirdim olmadı
.RowSource = "A2:r65536"
.ColumnWidths = "50;50;50;50;50;50;50;50;50;50;50;50;50;50;50;50;50;50"
.ColumnHeads = False
End With
Set sh = Nothing
End Sub
Private Sub CommandButton2_Click()
Dim sh As Worksheet, shR As Worksheet
Set sh = Sheets("sayfa2")
Set shR = Sheets("RAPOR")
shR.Range("A2:R65000").ClearContents
Dim i As Long, sat As Long
Application.ScreenUpdating = False
sat = 2
Sheets("Rapor").Range("A6:CZ65536").ClearContents
For i = 2 To Cells(65536, "A").End(xlUp).Row
Sheets("Rapor").Range("A" & sat & ":CZ" & sat).Value = _
Range("A" & i & ":CZ" & i).Value
sat = sat + 1
Next
Application.ScreenUpdating = True
shR.Select
Set sh = Nothing
Set shR = Nothing
End Sub