All i wanna accomplish here is to reference the Offset(, 1) of my cases "vC" to my "vI" within each area defined by "vI"
dcG(vI.Value) = vC("Gewinn").Offset(, 1).Value
apparently isnt viable, how would i go about using one of the two cases to define a dictionary entry?
With Sheets("WWData")
For Each vI In rngE
nor am i allowed to use "For Each vI In rngE" a second time it seems, not sure what to do from here ~
dcG(vI.Value) = vC("Gewinn").Offset(, 1).Value
apparently isnt viable, how would i go about using one of the two cases to define a dictionary entry?
With Sheets("WWData")
For Each vI In rngE
nor am i allowed to use "For Each vI In rngE" a second time it seems, not sure what to do from here ~
Code:
Sub RekapitulationDic()
Dim dcG As Object, dcV As Object
Set dcG = CreateObject("scripting.dictionary")
Set dcV = CreateObject("scripting.dictionary")
Dim rngE As Range
Set rngE = Application.Range("E2", Application.Range("E" & Rows.Count).End(xlUp))
For Each vI In rngE
If Not IsEmpty(vI.Value) Then
For Each vC In Range(vI, vI.End(xlDown)).Offset(, -4)
Select Case vC.Value
Case "Gewinn", "Verlust"
With Sheets("WWData")
For Each vI In rngE
dcG(vI.Value) = vC("Gewinn").Offset(, 1).Value
dcV(vI.Value) = vC("Verlust").Offset(, 1).Value
Next vI
End With
With Sheets("Rekapitulation")
For Each vI In .Range("A", .Range("A" & Rows.Count).End(xlUp))
If dcG.exists(vI.Value) Then vI.Offset(, 2).Value = dcG(vI.Value)
If dcV.exists(vI.Value) Then vI.Offset(, 2).Value = dcV(vI.Value)
Next vI
End With
End Select
Next vC
End If
Next vI