Which is better coding - A) or B)?
A)
Sub Rectangle1_Click()
For x = 1 To 1000
Range("A1") = x
Next
End Sub
B)
Option Explicit
Sub Rectangle1_Click()
'Procedure to do a count up to 1000 and to show the value in cell A1
'Original version: October 29 2011; Author: PeterCar
Dim iLoop As Integer
Dim iMax_Count As Integer
iMax_Count = 1000
For iLoop = 1 To iMax_Count
Range("A1") = iLoop
Next
End Sub
I would say that A) is better, because B) is lazy.
A)
Sub Rectangle1_Click()
For x = 1 To 1000
Range("A1") = x
Next
End Sub
B)
Option Explicit
Sub Rectangle1_Click()
'Procedure to do a count up to 1000 and to show the value in cell A1
'Original version: October 29 2011; Author: PeterCar
Dim iLoop As Integer
Dim iMax_Count As Integer
iMax_Count = 1000
For iLoop = 1 To iMax_Count
Range("A1") = iLoop
Next
End Sub
I would say that A) is better, because B) is lazy.