ExcelChampion
Well-known Member
- Joined
- Aug 12, 2005
- Messages
- 976
Ohhhh! I interpreted it to mean something else...duh.
There are some comments in this thread that offer the ubiquitous claim that [A1] notation is slower that other methods.
I have never been able to come up with a model that supports this claim.
Can anyone refer me to an example that shows [A1] notation is slower?
Private Sub CommandButton1_Click()
Dim Ct As Long
Dim TStart As Double, TEnd As Double
TStart = Timer
For Ct = 1 To 100000
[A1].Select
Next Ct
TEnd = Timer
MsgBox TEnd - TStart
End Sub
Private Sub CommandButton2_Click()
Dim Ct As Long
Dim TStart As Double, TEnd As Double
TStart = Timer
For Ct = 1 To 100000
Range("A1").Select
Next Ct
TEnd = Timer
MsgBox TEnd - TStart
End Sub
Ahh, if only it were my choice!!!Perhaps it's time for you to upgrade?
I guess, like most things, the difference in runtime between the two methods is very small with tiny bits of test code, however, if you were using it in a very large project it might be noticable. Just because this example gives a couple of seconds difference in 100,000 lines, doesn't mean that the difference would not be more noticable if you were using it in another way (i.e. not just selecting a cell)However, for the extra 1.73 seconds run-time for 100,000 pieces of code execution, I'll just stick to using [A1] notation.
doesn't mean that the difference would not be more noticable if you were using it in another way (i.e. not just selecting a cell)
I definitely agree here. I love array's.Th eother advantage to working in an array is that it contains ONLY the .Value property of the source range, hence it can be manipulated more quickly, potentially with less code.