Sub SayıUret()
    x = 0
    sat = 112
    Sira = [g65536].End(3).Row + 1
    For i = 7 To 112
        If Cells(i, "c") = "*" Then Son = Son + 1
    Next i
    If Son = Cells(sat, "a") Then
        'Sor = MsgBox("Tüm öğrenciler çekilmiştir, kura çekimini sıfırlamak istiyor musunuz?", vbQuestion + vbYesNo, "UYARI")
        'If Sor = vbNo Then Exit Sub
        'If Sor = vbYes Then
        'Range(Cells(1, 1), Cells(sat, 2)).Interior.ColorIndex = 35
        Range("c1:c120").ClearContents
        
        [a1,a5] = ""
        Range(Cells(1, "g"), Cells(Sira - 1, "h")) = ""
        'Exit Sub
    End If
    'End If
basla:
    Randomize
    sayi = Int(Cells(sat, "a") * Rnd + 1) + 6
    Range("a1") = Cells(sayi, "b")
    'If Cells(sayi, "b").Interior.ColorIndex = 6 Then GoTo basla
    'Cells(sayi, "b").Interior.ColorIndex = 6
    If Cells(sayi, "c") = "*" Then GoTo basla
    Cells(sayi, "c") = "*"
    [a5] = [a5] + 1
    If [g1] = "" Then Sira = 1
    Cells(Sira, "g") = [a5] & "-"
    Cells(Sira, "g").Offset(0, 1) = [a1]
    Cells(Sira, "g").Offset(0, 2) = sayi
End Sub