loop until certain row

ApolloID

Well-known Member
Joined
Jun 8, 2010
Messages
769
Hi, i need to loop a code until row 1500, and then to stop.

How can i do this?

Thanks!
 

Excel Facts

Get help while writing formula
Click the italics "fx" icon to the left of the formula bar to open the Functions Arguments dialog. Help is displayed for each argument.
Code:
Sub FixedRowCounter()
    Dim rngCell     As Range
    
    For Each rngCell In Range("A1:A1500")
        ' Your Code Here
    Next
End Sub
 
Upvote 0
Up or Down ??

Code:
for r = 1 to 1500 step 1
your stuff
next r
OR
Code:
for r = 1500 to 1 step -1
your stuff
next r

Or, provide a few more clues on what you want to do in the loop, because it could be a Do Loop or a While / wend
 
Upvote 0
Hi, this was my code:
Code:
Sub Loop1()
    Do
    ActiveCell.RowHeight = 216
    ActiveCell.Offset(3, 0).Select
ActiveCell.RowHeight = 216
    Loop Until .......
End Sub

I need to set the hight of rows to 216, from three to three rows.

Thanks!
 
Upvote 0
what about
Code:
Sub hite()
    With Rows("1:1500")
       .RowHeight = 216
    End With
End Sub
 
Upvote 0

Forum statistics

Threads
1,224,599
Messages
6,179,831
Members
452,947
Latest member
Gerry_F

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top