Hallo Excel Freunde,
habe ein Problem mit einer For Next Schleife, erstens müßte diese in VAB Basic umgeschrieben werden, da sie jetzt nur in Basic funktioniert. Die For-Next Schleife II = A to B sollte Zahlenwerte in (II) bei fünf Durchläufe wie in der Kontroll-Ausgabe angegeben erzeugen. Den Anfangs- VBA Code habe ich selbst versucht zuschreiben, aber weiter kam ich nicht.
Gruß kalli
Sub Makro2()
Dim intNr As Integer, antNr As Integer, entNr As Integer
intNr = IIf(Cells(15, 9) < 12, Cells(15, 9) + 1, 1)
antNr = IIf(Cells(15, 1) < 12, Cells(15, 12) - 1, 12) 'rückwärts Zähler 12 bis 1
If antNr < 1 Then antNr = 12
bntNr = IIf(Cells(15, 1) < 12, Cells(15, 13) - 1, 12) 'rückwärts Zähler 12 bis 1
If entNr < 1 Then entNr = 12
''''''''''''''''''''''''''''''''''''''''''''
A = 11 ' = antNr - statt A = 11
B = 12 ' = bntNr - statt B = 12
For I = 1 To 5
For ii = A To B 'in < ii > sollte diese Zahleninhalte beinhalten
' 11 12 10 11 12 8 9 10 11 5 6 7 8 9 1 2 3 4 5 6
A = A – 1 ' = antNr = entNr - 1 - statt A = A - 1
B = B – 1 ' = bntNr = entNr - 1 - statt B = B - 1
Next ii
A = A + 1 ' = antNr = entNr - 1 - statt A = A + 1
B = B + 2 ' = bntNr = entNr - 1 - statt B = B + 2
Next I
'''''''''''''''''''''''''''''''''''''''''''''
Cells(15, 10) = ii ' .................Cells(15, 10) = ii
End Sub