Attribute VB_Name = "Module1" Public Sub Vertailua_Hidas() 1 Dim AlkuAika As Date 2 Dim LoppuAika As Date 3 Dim RiviNo As Long 4 AlkuAika = Now() 5 For RiviNo = 4 To 65536 6 Randomize 7 ActiveSheet.Cells(RiviNo, 1).Value = Rnd(1) 8 Next RiviNo 9 LoppuAika = Now() 10 MsgBox "Täyttö valmis. Aikaa kului: " & Format(LoppuAika - AlkuAika, "hh:Nn:ss") End Sub Public Sub Vertailua_Nopeampi1() 1 Dim AlkuAika As Date 2 Dim LoppuAika As Date 3 Dim RiviNo As Long 4 AlkuAika = Now() 5 Application.ScreenUpdating = False 6 For RiviNo = 4 To 65536 7 Randomize 8 ActiveSheet.Cells(RiviNo, 1).Value = Rnd(1) 9 Next RiviNo 10 Application.ScreenUpdating = True 11 LoppuAika = Now() 12 MsgBox "Täyttö valmis. Aikaa kului: " & Format(LoppuAika - AlkuAika, "hh:Nn:ss") End Sub Public Sub Vertailua_Nopeampi2() 1 Dim AlkuAika As Date 2 Dim LoppuAika As Date 3 Dim RiviNo As Long 4 AlkuAika = Now() 5 Application.Calculation = xlCalculationManual 6 For RiviNo = 4 To 65536 7 Randomize 8 ActiveSheet.Cells(RiviNo, 1).Value = Rnd(1) 9 Next RiviNo 10 Application.Calculate 11 Application.Calculation = xlCalculationAutomatic 12 LoppuAika = Now() 13 MsgBox "Täyttö valmis. Aikaa kului: " & Format(LoppuAika - AlkuAika, "hh:Nn:ss") End Sub Public Sub Vertailua_Nopein() 1 Dim AlkuAika As Date 2 Dim LoppuAika As Date 3 Dim RiviNo As Long 4 AlkuAika = Now() 5 Application.ScreenUpdating = False 6 Application.Calculation = xlCalculationManual 7 For RiviNo = 4 To 65536 8 Randomize 9 ActiveSheet.Cells(RiviNo, 1).Value = Rnd(1) 10 Next RiviNo 11 Application.Calculate 12 Application.Calculation = xlCalculationAutomatic 13 Application.ScreenUpdating = True 14 LoppuAika = Now() 15 MsgBox "Täyttö valmis. Aikaa kului: " & Format(LoppuAika - AlkuAika, "hh:Nn:ss") End Sub