Range("A2" & Rows.Count).Sort .Range("A2"), xlAscending, , , , , , xlNo
bu kodu ekledim listbox sıralama kodunu silip Private Sub UserForm_Initialize() içindeki Tabii sonuç sayfadaki çıkması naormalmi bilmiyorum sizin dosyadada böyle geliyor rakamlar olmadan.
Private Sub UserForm_Initialize()
Dim son As Integer
Application.ScreenUpdating = False
Set SÝ = Sheets("liste")
SÝ.Unprotect "4455"
Dim arr
arr = Array("MUSTERININ ADI SOYADI", "BORC", "ALACAK", "KALAN BAKIYE")
With SÝ
SÝ.Range("A11").Value = arr
SÝ.[A21000].Clear
For Z = 2 To Sheets.Count
If LCase(Sheets(Z).Name) <> "sayfa1" And LCase(Sheets(Z).Name) <> "liste" Then
.Cells(.Range("A" & Rows.Count).End(3).Row + 1, 1) = Sheets(Z).[a1].Value
.Cells(.Range("A" & Rows.Count).End(3).Row, 2) = Sheets(Z).[G5].Value
.Cells(.Range("A" & Rows.Count).End(3).Row, 3) = Sheets(Z).[ý5].Value
.Cells(.Range("A" & Rows.Count).End(3).Row, 4) = Sheets(Z).[K4].Value
End If
Next
.Range("A2" & Rows.Count).Sort .Range("A2"), xlAscending, , , , , , xlNo
.Range("A" & .Range("A" & Rows.Count).End(3).Row + 2) = "TOPLAMLAR"
.Range("B" & .Range("A" & Rows.Count).End(3).Row) = WorksheetFunction.Sum(.Range("B2:B65536"))
.Range("C" & .Range("A" & Rows.Count).End(3).Row) = WorksheetFunction.Sum(.Range("C2:C65536"))
.Range("D" & .Range("A" & Rows.Count).End(3).Row) = WorksheetFunction.Sum(.Range("D265536"))
Application.ScreenUpdating = True
'MsgBox "AKTARMA ÝÞLEMÝ TAMAMLANMIÞTIR." & vbCrLf & vbCrLf
SÝ.Protect "4455"
ListBox1.ColumnHeads = True
ListBox1.ColumnWidths = "300;95;95;105"
son = Sheets("liste").Cells(Rows.Count, 1).End(3).Row
If son = 1 Then ListBox1.RowSource = "liste!A2:F2"
If son > 1 Then
.Unprotect "4455"
.Range("A" & son).Resize(1, 4).Interior.ColorIndex = 4 '4 yesil renk 1 den 56 ya kadar denenebilir.
With .Range("A" & son)
.HorizontalAlignment = xlRight
.VerticalAlignment = xlBottom
End With
.Range("B2:C" & Rows.Count).NumberFormat = "#,##0.00"
.Range("D2" & Rows.Count).NumberFormat = "#,##0.00_ ;[Red]-#,##0.00 " 'Formati kirmizi renk göstermek icin
.Range("A2" & son).Borders.LineStyle = 1 'cizgi icin
.Range("A2" & son).Font.Bold = True 'Yazi kalinlasma
.Range("A" & son + 1).Select
ListBox1.RowSource = "liste!A2:F" & son
.Protect "4455"
End If
End With
End Sub