Betrifft: VBA - Datum, Wochentag
von: Fred Neumann
Dim z, arr(7), x, i
Sheets("ListeSpiele").Range("A2:N2000").ClearContents
Set dict = CreateObject("Scripting.Dictionary")
For z = 3 To 2000
ky = Cells(z, 7)
If ky <> "" Then
If Not dict.exists(ky) Then
arr(7) = z
arr(0) = 1 'Bets
arr(1) = Cells(z, 11) 'Einsatz
arr(2) = Cells(z, 14) 'Gewinn
arr(3) = Cells(z, 15) 'gewonnen
arr(4) = Cells(z, 16) 'patt
arr(5) = Cells(z, 17) 'verl
arr(6) = Cells(z, 18) 'tag
dict.Add ky, arr
Else
x = dict(ky)
x(0) = x(0) + 1: x(1) = x(1) + Cells(z, 11): x(2) = x(2) + Cells(z, 14): x(3) = _
x(3) + Cells(z, 15): x(4) = x(4) + Cells(z, 16): x(5) = x(5) + Cells(z, 17): x(6) = x(6) + Cells(z, 28)
dict(ky) = x
End If
End If
Next z
ze = 2
With Sheets("ListeSpiele")
For Each ky In dict.Keys
x = dict(ky)
z = x(7)
Range(Cells(z, 1), Cells(z, 7)).Copy .Cells(ze, 1)
.Cells(ze, 8) = x(1)
.Cells(ze, 9) = x(2)
.Cells(ze, 10) = x(0)
.Cells(ze, 11) = x(3)
.Cells(ze, 12) = x(4)
.Cells(ze, 13) = x(5)
.Cells(ze, 14) = x(6)
ze = ze + 1
Next ky
End With
In "ListeSpiele" soll in die 14. Spalte der Wochentag eingetragen werden, welcher in "Tabelle1" 28. Spalte steht.
Betrifft: AW: VBA - Datum, Wochentag
von: 1712478.html
Geschrieben am: 11.09.2019 15:10:36
Hallo Fred,
keine Ahnung was bei dir krumm laeuft, aber bei mir wird der Wochentag eingetragen.
Funktioniert.
Gruss Torsten
Betrifft: AW: VBA - Datum, Wochentag
von: 1712496.html
Geschrieben am: 11.09.2019 16:14:50
Hallo Torsten,
Ja,- aber der "falsche"
Gruß
Fred
Betrifft: AW: VBA - Datum, Wochentag
von: 1712512.html
Betrifft: AW: VBA - Datum, Wochentag
von: 1712520.html
Geschrieben am: 11.09.2019 17:25:48
Hallo ChrisL,
danke für deine Erklärung,- und nu funzt es !!
Gruß
Fred