Hallo. Ich hab ein Problem mit einem Makro, und zwar soll dieses Makro Werte von einer Spalte in ein anderes Blatt kopieren, diese dann zählen und die doppelten löschen. Nur leider bekomm ich auf dem Ausgangeblatt nur Nullen wieder. Mit „normalen“ Zahlen funktioniert das Makro nur irgendwie nicht mit der Uhrzeit. Hab auch mal eine Excel Tabelle hochgeladen wie das aussehen sollte.
Hier das Makro
Dim Zeile As Long, C As Long, colC As New Collection
On Error Resume Next
With Worksheets(„Tabelle1“)
For Zeile = 8 To .Cells(Rows.Count, 1).End(xlUp).Row '1=Spalte A
colC.Add Item:=CStr(.Cells(Zeile, 1)), Key:=CStr(.Cells(Zeile, 1))
Next Zeile
End With
On Error GoTo 0
With Worksheets(„Tabelle2“)
.Range(„A:B“).ClearContents
.Range(„A1“).Value = „Uhrzeit“
.Range(„B1“).Value = „Anzahl“
For Zeile = 1 To colC.Count
.Cells(Zeile + 1, 1).Value = Val(colC(Zeile))
Next Zeile
.Range(„A2:A“ & Zeile - 1).Sort Key1:=.Range(„A2“), Order1:=xlAscending, Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
.Range(„B2:B“ & Zeile - 1).FormulaLocal = „=ZÄHLENWENN(Tabelle1!A:A;A2)“
.Range(„B2:B“ & Zeile - 1).Value = .Range(„B2:B“ & Zeile - 1).Value
End With
Hier der Link für die Exceltablle
http://rapidshare.com/files/280815047/Mappe.xls.html