LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default For Next with negative step ?

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.
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a Drop Down List with Step by Step Instructions for 2007 remarkable Excel Worksheet Functions 2 March 22nd 09 04:36 AM
Need step by step to add invoice numbering to excel template rmt New Users to Excel 4 July 6th 08 11:45 PM
Need step by step instructions to try, not a demo. Can't remember [email protected] Excel Worksheet Functions 1 June 15th 06 09:24 PM
What is the step-by-step procedure for making a data list? Bobgolfs56 Excel Discussion (Misc queries) 1 April 23rd 05 02:19 PM
I need step by step instructions to create a macro for 10 imbedde. diana Excel Worksheet Functions 3 January 31st 05 01:56 AM


All times are GMT +1. The time now is 01:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"