Sub test()
Dim ws As Worksheet, x As Long
x = 1
For Each ws In Sheets
ws.Range("A1:A100") = Evaluate("SEQUENCE(100,1," & x & ",1)")
x = x + 100
Next ws
End Sub
This you want in how many sheets. Since it cannot loop to infinite sheets, which does not help in any way
Maybe the below to do it on every worksheet in the workbook:
VBA Code:Sub test() Dim ws As Worksheet, x As Long x = 1 For Each ws In Sheets ws.Range("A1:A100") = Evaluate("SEQUENCE(100,1," & x & ",1)") x = x + 100 Next ws End Sub [/QUOTE] While import file will have many row maybe more than 5000 row, so I want to cut 1-100 row to in 1 excel and then 101-201 loop file until to 5000 row. Sub test() Sheet60.Range("A1:BX100").Copy Workbooks.Add Application.DisplayAlerts = False ActiveSheet.Paste Destination:=Range("A1") ActiveWorkbook.SaveAs ("D:\Implement\") ActiveWorkbook.Close Application.DisplayAlerts = True
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.