AW: VBA: besondere Auflistung
13.07.2013 16:00:34
ransi
Hallo Walter
Teste mal dies:
' **********************************************************************
' Modul: Tabelle1 Typ: Element der Mappe(Sheet, Workbook, ...)
' **********************************************************************
Option Explicit
Sub aufruf()
Dim arr As Variant
Dim L As Long
Dim I As Integer
Dim myDic As Object
Dim vntWert
Dim out As Variant
arr = Range("C5:O10").Value 'Anpassen
Set myDic = CreateObject("Scripting.Dictionary")
For L = LBound(arr) To UBound(arr)
If Not myDic.exists(arr(L, 1)) Then
myDic(arr(L, 1)) = WorksheetFunction.Index(arr, L)
Else:
For I = LBound(myDic(arr(L, 1))) To UBound(myDic(arr(L, 1)))
If myDic(arr(L, 1))(I) = "" Then
vntWert = WorksheetFunction.Index(arr, L, I)
myDic(arr(L, 1)) = fncMachs(myDic(arr(L, 1)), I, vntWert)
End If
Next
End If
Next
out = WorksheetFunction.Transpose(WorksheetFunction.Transpose(myDic.items))
Range("Q5").Resize(UBound(out), UBound(out, 2)) = out 'Anpassen
End Sub
Function fncMachs(ByVal vnt As Variant, intIndex, Wert) As Variant
vnt(intIndex) = Wert
fncMachs = vnt
End Function
ransi