How to create by 1-100 row to 1 sheet then loop next to...

Faozan

Banned user
Joined
May 14, 2023
Messages
25
Office Version
  1. 365
  2. 2021
  3. 2019
  4. 2016
  5. 2013
  6. 2011
  7. 2010
  8. 2007
  9. 2003 or older
Platform
  1. Windows
  2. MacOS
  3. Mobile
  4. Web
1-100 = sheet(1)
101-199 = sheet(2)
200-299= sheet(3)
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
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
 
Upvote 0
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
If loop next to infinity? By conditions cut 100 to 1 sheet ?
 
Upvote 0
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
 
Upvote 1
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
This will loop infinity or not?
 
Upvote 0
No, it will put:
1 to 100 in sheet1
101 to 200 in sheet2
201 to 300 in sheet3
 
Upvote 0
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.
 
Upvote 0
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.
Input 1-100 to 1 sheet and then loop like this.
 
Upvote 0

Forum statistics

Threads
1,223,903
Messages
6,175,284
Members
452,630
Latest member
OdubiYouth

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