For Next with negative step ?
Not sure what your question is. Yes, negative step values are allowed ..
put your cursor on one of the "for" statements in your code and hit F1
to get help.
From that help text:
For counter = start To end [Step step]
Clif
"Slim Slender" wrote in message
...
Public Sub FiftyFifty1()
Dim x As Integer, y As Integer
With ActiveSheet
For y = 1 To 50
For x = 0 To y
.Cells(y, 1 + x).Value = y - x & "/" & x
Next x
Next y
End With
End Sub
The above bit of code generates a bunch of pairs of numbers in a
wedge-
shaped pattern on a spreadsheet.
If you copy and run it you'll see the pattern.
What I want is to generate another wedge-shaped pattern of pairs of
numbers starting on line 51 and going to line 100, where line 51 has
50 elements: 50/1, 49/2, 48/3 . . . 3/48, 2/49, 1/50 (all pairs add up
to 51)
line 52 has 49 elements: 50/2, 49/3, 48/4 . . . 4/48, 3/49, 2/50. (all
pairs add up to 52)
Line 99 has 2 elements: 50/49, 49/50 (add up to 99)
Line 100 has only: 50/50.
--
Clif McIrvin
(clare reads his mail with moe, nomail feeds the bit bucket :-)
|