![]() |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 04:20 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com