In this attachment, I'm running a loop for serial numbers but it runs upto 32000 or it creates upto 32000 serial numbers, if I want to create 100K, or 300K then from where the code will be changed.
In this attachment, I'm running a loop for serial numbers but it runs upto 32000 or it creates upto 32000 serial numbers, if I want to create 100K, or 300K then from where the code will be changed.
The issue is you have x as Integer, it needs to long for stuff over 32000
![]()
Sub Loop2() Dim X As Long For X = 1 To 100000 Range("A" & X).Value = X Next X End Sub
Hi Daveexcel
Thank you very much for your quick reply and solution
if you go to how you run the code, choose edit, then the change in the code should be obvious! as well as changing the type to long
Another way:
![]()
Option Explicit Sub Loop2() Dim X As Long For X = 1 To Range("A" & Rows.Count).End(xlUp).Row Range("A" & X).Value = X Next X End Sub
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks