Private Sub CommandButton1_Click()
Dim rg As Range
For i = Range("AG6") To Range("AG7")
Range("AG5") = i
Do
[O18:X19,O26:X27].ClearContents
For Each rg In Range("O18:X19,O26:X27")
rg.Value = Int(Rnd() * 40 - 20)
Next
Loop Until (Range("AA18").Value > 0.85 And Range("AA26").Value > 0.85)
ActiveSheet.PageSetup.PrintArea = "A1:AF33"
ActiveSheet.PrintOut
Next
End Sub