DOSYA İndirmek/Yüklemek için ÜCRETLİ ALTIN ÜYELİK Gereklidir!
Altın Üyelik Hakkında Bilgi
Private Sub CommandButton1_Click()
Dim sh As Worksheet, z As Object, sat As Long, i As Long, myarr(), n As Long
ListBox1.Clear
Set sh = Sheets("kasagiris")
sat = sh.Cells(65536, "A").End(xlUp).Row
ReDim myarr(1 To 4, 1 To sat)
Set z = CreateObject("Scripting.Dictionary")
For i = 6 To sat
If CInt(Month(sh.Cells(i, "A").Value)) <= Tarih.ListIndex + 1 Then
If Not z.exists(sh.Cells(i, "B").Value) Then
n = n + 1
z.Add sh.Cells(i, "B").Value, n
End If
myarr(1, z.Item(sh.Cells(i, "B").Value)) = sh.Cells(i, "B").Value
myarr(2, z.Item(sh.Cells(i, "B").Value)) = sh.Cells(i, "C").Value
myarr(3, z.Item(sh.Cells(i, "B").Value)) = myarr(3, z.Item(sh.Cells(i, "B").Value)) + sh.Cells(i, "Q").Value
myarr(4, z.Item(sh.Cells(i, "B").Value)) = myarr(4, z.Item(sh.Cells(i, "B").Value)) + sh.Cells(i, "R").Value
End If
Next i
If n > 0 Then
ReDim Preserve myarr(1 To 4, 1 To n)
ListBox1.Column = myarr
End If
End Sub
Evren hocam ellerinize sağlık ben eksik anlattım galiba istediğim gibi olmamış.
Örneğin,
Ocak - Şubat dediğimde mesela 398 plakalı aracın o aylar içinnde toplam hasılat ve tur sayısını görmek istedim.
Plaka Şoför Hasılat Tur sayısı
398 Serdar 364,45 24
gibi.
İlgilenirseniz çok sevinirim.
Teşekkürler
Private Sub CommandButton1_Click()
Dim sh As Worksheet, z As Object, sat As Long, i As Long, myarr(), n As Long
ListBox1.Clear
Set sh = Sheets("kasagiris")
sat = sh.Cells(65536, "A").End(xlUp).Row
ReDim myarr(1 To 4, 1 To sat)
Set z = CreateObject("Scripting.Dictionary")
For i = 6 To sat
If CInt(Month(sh.Cells(i, "A").Value)) <= Tarih.ListIndex + 1 Then
If Not z.exists(sh.Cells(i, "A").Value & "-" & sh.Cells(i, "B").Value) Then
n = n + 1
z.Add sh.Cells(i, "A").Value & "-" & sh.Cells(i, "B").Value, n
End If
myarr(1, z.Item(sh.Cells(i, "A").Value & "-" & sh.Cells(i, "B").Value)) = sh.Cells(i, "B").Value
myarr(2, z.Item(sh.Cells(i, "A").Value & "-" & sh.Cells(i, "B").Value)) = sh.Cells(i, "C").Value
myarr(3, z.Item(sh.Cells(i, "A").Value & "-" & sh.Cells(i, "B").Value)) = myarr(3, z.Item(sh.Cells(i, "A").Value & "-" & sh.Cells(i, "B").Value)) + sh.Cells(i, "Q").Value
myarr(4, z.Item(sh.Cells(i, "A").Value & "-" & sh.Cells(i, "B").Value)) = myarr(4, z.Item(sh.Cells(i, "A").Value & "-" & sh.Cells(i, "B").Value)) + sh.Cells(i, "R").Value
End If
Next i
If n > 0 Then
ReDim Preserve myarr(1 To 4, 1 To n)
ListBox1.Column = myarr
End If
End Sub