kemal turan
Altın Üye
- Katılım
- 10 Haziran 2011
- Mesajlar
- 1,677
- Excel Vers. ve Dili
- Excel 2010 32 bit
DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Private Sub CommandButton6_Click()
With ListView1
.SortOrder = lvwAscending
.SortKey = 2
.Sorted = True
End With
End Sub
Private Sub CommandButton5_Click()
For a = 5 To ListView1.ListItems.Count
If IsDate(ListView1.ListItems(a).Text) = True Then
trh = CDate(ListView1.ListItems(a).Text)
ListView1.ListItems(a).Text = CDbl(trh)
End If
Next
With ListView1
.SortOrder = lvwAscending
.SortKey = 5
.Sorted = True
End With
For a = 5 To ListView1.ListItems.Count
If IsNumeric(ListView1.ListItems(a).Text) = True Then
trh = CDate(ListView1.ListItems(a).Text)
ListView1.ListItems(a).Text = Format(trh, "dd.mm.yyyy")
End If
Next
ListView1.Sorted = False
End Sub
Private Sub ComboBox3_Change()
Dim i As Long
Set SR = Sheets("VERITABANI")
ListView1.ListItems.Clear
ListView1.FullRowSelect = True
With ListView1
For i = 2 To SR.Cells(65536, "A").End(xlUp).Row
If UCase(Replace(Replace(SR.Cells(i, "B").Value, "ı", "I"), "i", "İ")) _
Like "*" & "PÖRTFÖY" & "*" _
And UCase(Replace(Replace(SR.Cells(i, "C").Value, "ı", "I"), "i", "İ")) _
Like "*" & ComboBox3.Value & "*" _
And UCase(Replace(Replace(SR.Cells(i, "AB").Value, "ı", "I"), "i", "İ")) _
Like "*" & "ÖDENECEK" & "*" Then
.ListItems.Add , , SR.Cells(i, "A")
X = X + 1
.ListItems(X).ListSubItems.Add , , SR.Cells(i, "L")
.ListItems(X).ListSubItems.Add , , SR.Cells(i, "M")
.ListItems(X).ListSubItems.Add , , SR.Cells(i, "N")
.ListItems(X).ListSubItems.Add , , SR.Cells(i, "O")
.ListItems(X).ListSubItems.Add , , Format(CDate(SR.Cells(i, "P").Value), "dd.mm.yyyy")
.ListItems(X).ListSubItems.Add , , SR.Cells(i, "R")
.ListItems(X).ListSubItems.Add , , Format(CDbl(SR.Cells(i, "V").Value), "#,##0.00")
.ListItems(X).ListSubItems.Add , , Format(CDbl(SR.Cells(i, "W").Value), "#,##0.00")
.ListItems(X).ListSubItems.Add , , SR.Cells(i, "X")
End If
Next i
End With
Set s1 = Sheets("VERITABANI")
Veri1 = WorksheetFunction.SumIfs(s1.Range("V:V"), s1.Range("B:B"), "PÖRTFÖY", s1.Range("I:I"), "ÖDENECEK", s1.Range("C:C"), ComboBox3.Value)
TextBox9 = Format(CDbl(Veri1), "#,##0.00")
Veri2 = WorksheetFunction.SumIfs(s1.Range("W:W"), s1.Range("B:B"), "PÖRTFÖY", s1.Range("I:I"), "ÖDENECEK", s1.Range("C:C"), ComboBox3.Value)
TextBox10 = Format(CDbl(Veri2), "#,##0.00")
TextBox11 = Format(CDbl(TextBox9.Value) - CDbl(TextBox10.Value), "#,##0.00")
End Sub
[SIZE="2"]Private Sub CommandButton1_Click()
For a = 1 To ListView1.ListItems.Count
With [COLOR="Blue"]ListView1.ListItems(a).ListSubItems(15)[/COLOR]
If IsDate(.Text) = True Then
trh = CDate(.Text)
.Text = CDbl(trh)
End If
End With
Next
With ListView1
.SortOrder = lvwAscending
.SortKey = [COLOR="Blue"]15[/COLOR]
.Sorted = True
End With
For a = 1 To ListView1.ListItems.Count
With[COLOR="Blue"] ListView1.ListItems(a).ListSubItems(15)[/COLOR]
If IsNumeric(.Text) = True Then
trh = CDate(.Text)
.Text = Format(trh, "dd.mm.yyyy")
End If
End With
Next
ListView1.Sorted = False
End Sub [/SIZE]
Private Sub CommandButton5_Click()
For a = 1 To ListView1.ListItems.Count
With ListView1.ListItems(a).ListSubItems([B]5[/B])
If IsDate(.Text) = True Then
trh = CDate(.Text)
.Text = CDbl(trh)
End If
End With
Next
With ListView1
.SortOrder = lvwAscending
.SortKey = [B]5[/B]
.Sorted = True
End With
For a = 1 To ListView1.ListItems.Count
With ListView1.ListItems(a).ListSubItems([B]5[/B])
If IsNumeric(.Text) = True Then
trh = CDate(.Text)
.Text = Format(trh, "dd.mm.yyyy")
End If
End With
Next
ListView1.Sorted = False
End Sub
Private Sub ListView1_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
For a = 1 To ListView1.ListItems.Count
With ListView1.ListItems(a).ListSubItems(5)
If IsDate(.Text) = True Then
trh = CDate(.Text)
.Text = CDbl(trh)
End If
End With
Next
With ListView1
.SortOrder = lvwAscending
.SortKey = 5
.Sorted = True
End With
For a = 1 To ListView1.ListItems.Count
With ListView1.ListItems(a).ListSubItems(5)
If IsNumeric(.Text) = True Then
trh = CDate(.Text)
.Text = Format(trh, "dd.mm.yyyy")
End If
End With
Next
ListView1.Sorted = False
End Sub
Private Sub CommandButton6_Click()
With ListView1
.SortOrder = lvwAscending
.SortKey = 2
.Sorted = True
End With
End Sub
Dosyanızı siteden indirme imakınım yok; ama sanırım istediğiniz şöyle olmalıFakat aynı listvievde 2 nci kolonda firma adı sıralamasını aşağıdaki kodla butonla yapabiliyorum.Bunuda ListView1_ColumnClick olayına bağladığımda 2 nci kolonu butondaki gibi sıralamayıp tarih olan 5 nci kolonu sıralayan kod çalışıyor. Bu iki sıralama olayını birleştirebilirmiyiz.
[SIZE="2"]
Private Sub ListView1_ColumnClick(ByVal ColumnHeader As MSComctlLib.ColumnHeader)
[COLOR="Blue"]If ColumnHeader.Index - 1 = 2 Then[/COLOR]
With ListView1
.SortOrder = lvwAscending
.SortKey = 2
.Sorted = True
End With
[COLOR="Blue"] ElseIf ColumnHeader.Index - 1 = 5 Then[/COLOR]
For a = 1 To ListView1.ListItems.Count
With ListView1.ListItems(a).ListSubItems(5)
If IsDate(.Text) = True Then
trh = CDate(.Text)
.Text = CDbl(trh)
End If
End With
Next
With ListView1
.SortOrder = lvwAscending
.SortKey = 5
.Sorted = True
End With
For a = 1 To ListView1.ListItems.Count
With ListView1.ListItems(a).ListSubItems(5)
If IsNumeric(.Text) = True Then
trh = CDate(.Text)
.Text = Format(trh, "dd.mm.yyyy")
End If
End With
Next
ListView1.Sorted = False
[COLOR="Blue"]End If[/COLOR]
End Sub [/SIZE]