If loop next to infinity? By conditions cut 100 to 1 sheet ?Hi
Try
VBA Code:Sub test() Dim i& For i = 1 To 300 Select Case i Case Is <= 100 ' Code for sheet1 Case Is <= 200 ' Code for sheet2 Case Is < 300 ' Code for sheet3 End Select Next End Sub
Sub test()
Dim x As Long, s As Long
For x = 1 To 300 Step 100
s = s + 1
Sheets(s).Range("A1:A100") = Evaluate("SEQUENCE(100,1," & x & ",1)")
Next x
End Sub
This will loop infinity or not?Do you want to put the numbers onto the sheets as below?
VBA Code:Sub test() Dim x As Long, s As Long For x = 1 To 300 Step 100 s = s + 1 Sheets(s).Range("A1:A100") = Evaluate("SEQUENCE(100,1," & x & ",1)") Next x End Sub
Input 1-100 to 1 sheet and then loop like this.Loop to do what?
Your original post is so short you are leaving us guessing at what it is you want to do.
Also
1-100 = sheet(1) = 100 cells
101-199 = sheet(2) = 99 cells
200-299= sheet(3) = 100 cells
299 cells in total.
This you want in how many sheets. Since it cannot loop to infinite sheets, which does not help in any wayInput 1-100 to 1 sheet and then loop like this.