Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 12
Default Count backwards with a for next loop

Dont you count backwards with a for next loop using the following
For i = 1 To 4
Sheet1.Cells(i, 1) = i
Next i
I cant seem to get it to work. I also tried using a Step -1 but no luck
Any ideas ?
--
thank You
Gus
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 772
Default Count backwards with a for next loop

I think what you are wanting would be a for i = 4 to 1 step - 1
you were trying to step backward but increment at the same time.
--
-John
Please rate when your question is answered to help us and others know what
is helpful.


"Gus Chuch" wrote:

Dont you count backwards with a for next loop using the following
For i = 1 To 4
Sheet1.Cells(i, 1) = i
Next i
I cant seem to get it to work. I also tried using a Step -1 but no luck
Any ideas ?
--
thank You
Gus

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 477
Default Count backwards with a for next loop

Step -1 is the route!!
but you may need something like:

Sub tester()
With ActiveSheet
For i = 4 To 1 Step -1
Sheets("Sheet1").Cells(i, 1) = i
Next i
End With
End Sub

"Gus Chuch" wrote:

Dont you count backwards with a for next loop using the following
For i = 1 To 4
Sheet1.Cells(i, 1) = i
Next i
I cant seem to get it to work. I also tried using a Step -1 but no luck
Any ideas ?
--
thank You
Gus

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 320
Default Count backwards with a for next loop

For i = 4 to 1 step -1

"Gus Chuch" wrote:

Dont you count backwards with a for next loop using the following
For i = 1 To 4
Sheet1.Cells(i, 1) = i
Next i
I cant seem to get it to work. I also tried using a Step -1 but no luck
Any ideas ?
--
thank You
Gus

Reply
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
Count backwards N cells cferoiu Excel Worksheet Functions 0 February 2nd 10 12:50 PM
Loop backwards through selection? ppsa Excel Programming 5 July 30th 07 06:02 PM
Loop & Count Paul Black[_2_] Excel Programming 0 January 4th 07 07:24 AM
Count backwards leonidas[_30_] Excel Programming 3 June 29th 06 02:13 PM


All times are GMT +1. The time now is 01:26 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"