Bonjour,
Un autre bonne raison, c'est que d'autres macros peuvent interférer avec celle qui utilise .select et semer la pagaille.
Par exemple :
Avec ce code :
Dim temps
Sub test()
Dim t1 As Single, t2 As Single, i As Double, n As Long, m As String
Dim v1 As Variant, a1 As String, v2 As Variant, a2 As String
n = 2000
Worksheets("Feuil1").Select
Range("A1").Select
debTemps
' Avec .select
t1 = Timer
For i = n To 1 Step -1
Cells(i, Selection.Column).Select
v1 = Selection.Value
a1 = Selection.Address(False, False)
DoEvents
Next i
t1 = Timer - t1
' Sans .Select
t2 = Timer
For i = n To 1 Step -1
v2 = Worksheets(1).Cells(i, 1).Value
a2 = Worksheets(1).Cells(i, 1).Address(False, False)
DoEvents
Next i
t2 = Timer - t2
' Résultat
finTemps
m = "Avec Select : " & Format(t1, "0.000") & " s, fin en " & a1 & " = " & v1 & vbLf & _
"Sans Select : " & Format(t2, "0.000") & " s, fin en " & a2 & " = " & v2 & vbLf & _
vbLf & "Et sans Select c'est " & Format(t1 / t2, "0.0") & " fois plus rapide" & vbLf
MsgBox m
End Sub
Sub debTemps()
temps = Now + TimeValue("00:00:01")
Application.OnTime temps, "majTemps"
End Sub
Sub majTemps()
temps = Now + TimeValue("00:00:01")
Application.OnTime temps, "majTemps"
ActiveCell.Offset(0, 1).Activate
End Sub
Sub finTemps()
On Error Resume Next
Application.OnTime temps, Procedure:="majTemps", Schedule:=False
End Sub