C
cyzax7 via OfficeKB.com
hello there,
I have prob with my code that need your guide. I want to create a macro that
will generate numbers starting from 0 to 6 000 000 000 in Column A when user
click on the command button(Generate_Numbers). The numbers are in multiple of
50000. Below are the code: When I tried to debug the code, a message box
displayed showing a run time error.. Can someone show me where is the
mistakes ??
Sub Generate_Numbers()
Dim CountRow As Integer
Dim i As Double
For CountRow = 2 To cLastRow = 120000
i = 0
Worksheets("Data2").Cells(CountRow, "A").Value = i
i = i + 500000
CountRow = CountRow + 1
Next CountRow
End Sub
********Generate numbers command button in Worksheet ("Data2")
****************
Private Sub GenerateNumCommandButton1_Click()
Generate_Numbers
End Sub
**************************************************************************
tq
I have prob with my code that need your guide. I want to create a macro that
will generate numbers starting from 0 to 6 000 000 000 in Column A when user
click on the command button(Generate_Numbers). The numbers are in multiple of
50000. Below are the code: When I tried to debug the code, a message box
displayed showing a run time error.. Can someone show me where is the
mistakes ??
Sub Generate_Numbers()
Dim CountRow As Integer
Dim i As Double
For CountRow = 2 To cLastRow = 120000
i = 0
Worksheets("Data2").Cells(CountRow, "A").Value = i
i = i + 500000
CountRow = CountRow + 1
Next CountRow
End Sub
********Generate numbers command button in Worksheet ("Data2")
****************
Private Sub GenerateNumCommandButton1_Click()
Generate_Numbers
End Sub
**************************************************************************
tq