(13/05/2020, 21:00)m_demir yazdı: Çok teşekkürler Hocam ellerinize sağlık.
Hocam Daha önce rapor almak başlığı altında konu açmıştır siz ve Feraz hocam Rapor al olayını yazdığınız kodlarla hal etmiştiniz. UserForm1 de Rapor al butonu ile UserForm3 açılıyor ve liste sayfasına raporu aktarıyor. Çokta güzel olmuş. O zaman unutup size rapor UserForm3 de ve liste sayfasında alfabetik sıraya göre sıralansın demeyi unutmuşum. Daha önce açtığım bir konu olduğu için buraya yazdım. Size zahmet olmayacaksa bakabilirmisiniz. Saygılar.
Sıralama olayını alttaki gibi yapabilirsiniz.
CreateObject("System.Collections.ArrayList")
kullanılmıştır.
Private Sub UserForm_Initialize()
'ComboBox3.MatchEntry = fmMatchEntryComplete
Dim col As Object
Set col = CreateObject("System.Collections.ArrayList")
For i = 7 To [d65536].End(3).Row
If Not col.contains(CStr(Cells(i, "d").Value)) = True Then
col.Add CStr(Cells(i, 4))
'TextBox1.Text = CDate(Date) 'Form Açyly?ta otomatik tarih
End If
Next
ComboBox1.Clear
If col.Count > 0 Then
col.Sort
ComboBox3.List = col.toarray
End If
Set col = Nothing
'TextBox1.Text = CDate(Date) 'Form Açyly?ta otomatik tarih
ListBox1.ColumnCount = 12
ListBox1.ColumnWidths = "20;55;60;140;65;65;50;50;55;65;65;65"
ListBox1.ColumnHeads = True
ListBox1.RowSource = "A7:L" & [A65536].End(3).Row + 1
ComboBox1.RowSource = "Liste!l1:l2"
On Error Resume Next
TextBox21.Text = [e2]
TextBox22.Text = [e4]
TextBox23.Text = [e5]
TextBox60.Text = [C4]
TextBox61.Text = [C5]
TextBox29.Text = [a1]
TextBox24.Text = [H1]
TextBox25.Text = [H2]
TextBox27.Text = [H3]
TextBox63.Text = [H5]
TextBox62.Text = [J1]
TextBox64.Text = [J5]
TextBox65.Text = [L4]
TextBox95.Text = [H4]
TextBox82.Text = [J2]
'ComboBox1_Change
TextBox21 = Format(TextBox21, "#,##0.00")
TextBox22 = Format(TextBox22, "#,##0.00")
TextBox23 = Format(TextBox23, "#,##0.00")
TextBox60 = Format(TextBox60, "#,##0.00")
TextBox61 = Format(TextBox61, "#,##0.00")
TextBox24 = Format(TextBox24, "#,##0.00")
TextBox25 = Format(TextBox25, "#,##0.00")
TextBox27 = Format(TextBox27, "#,##0.00")
TextBox63 = Format(TextBox63, "#,##0.00")
TextBox62 = Format(TextBox62, "#,##0.00")
TextBox64 = Format(TextBox64, "#,##0.00")
TextBox65 = Format(TextBox65, "#,##0.00")
TextBox95 = Format(TextBox95, "#,##0.00")
TextBox82 = Format(TextBox82, "#,##0.00")
If LCase(ActiveSheet.Name) = "sayfa1" Or LCase(ActiveSheet.Name) = "liste" Or LCase(ActiveSheet.Name) = "ÞABLON" Then
ListBox1.Clear
Exit Sub
End If
End Sub