1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
| Sub ttt()
' Désactivation de la mise à jour de l'affichage afin d'accélérer l'exécution.
Application.ScreenUpdating = False
Dim NBSimul As Integer
NBSimul = 10000
' Nettoyage des données dans la feuille Memorisation
Sheets("Tx 1Y").range("B4:U15003").Clear
Sheets("Tx 10Y").range("B4:U15003").Clear
Dim destination As range
Dim destination2 As range
Set destination = Sheets("Tx 1Y").range("B4")
Set destination2 = Sheets("Tx 10Y").range("B4")
For i = 1 To NBSimul
Application.CalculateFull
Sheets("Feuil1").range("S6:S25").Copy
destination.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, operation:=xlNone, skipblanks:=False, Transpose:=True
Sheets("Feuil1").range("T6:T25").Copy
destination2.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, operation:=xlNone, skipblanks:=False, Transpose:=True
Set destination = destination.Offset(1, 0)
Set destination2 = destination2.Offset(1, 0)
Next i
Application.ScreenUpdating = True
MsgBox ("done!")
End Sub |
Partager