Option
Explicit
Public
out
As
Range
Public
ctZ
As
Integer
Public
ctS
As
Integer
Sub
durchlauf()
Dim
firstpos
As
Range
Dim
ze
As
Integer
Dim
sp
As
Integer
Dim
aktSP
As
String
Dim
aktZE
As
String
Dim
wert
As
String
Set
firstpos = Sheets(
"input"
).Range(
"A1"
)
Set
out = Sheets(
"output"
).Range(
"A1"
)
ze = 0
sp = 0
ctZ = 0
ctS = 0
While
firstpos.Offset(0, sp + 1).Value <> 0
sp = sp + 1
While
firstpos.Offset(ze + 1, 0).Value <> 0
ze = ze + 1
wert = firstpos.Offset(ze, sp).Value
If
wert <> Str(
"0"
)
And
wert <>
""
Then
aktSP = firstpos.Offset(0, sp).Value
aktZE = firstpos.Offset(ze, 0).Value
ausgabe aktSP, aktZE, wert
End
If
Wend
ze = 0
ctS = 0
Wend
End
Sub
Function
ausgabe(ze, sp, wert)
out.Offset(ctZ, ctS).Value = ze
out.Offset(ctZ, ctS + 1).Value = sp
out.Offset(ctZ, ctS + 2).Value = wert
ctZ = ctZ + 1
End
Function