Matemáticas 2

Classified in Mathematics

Written on in English with a size of 2.64 KB

 'taula torneig

    If modalitat = "I" Then

hora = InputBox("Introdueixi l'hora en la que es celebrarà el primer partit", "Registre de l'hora")

indi = total / 2

        i = 0

        individual = 6

        For i = i + 6 To indi + 5

        Worksheets("torneig").Range("B" & i).Value = hora + i - 6 & ":00"

        Worksheets("torneig").Range("E" & i).Value = "vs"

        Worksheets("torneig").Range("C" & i).Value = "Individual"

        Worksheets("torneig").Range("D" & i).Value = Worksheets("LlistaAleatoria").Range("A" & individual).Value

        Worksheets("torneig").Range("F" & i).Value = Worksheets("LlistaAleatoria").Range("A" & individual + 1).Value

        individual = individual + 2

         Next

    End If

       If modalitat = "D" Then

hora = InputBox("Introdueixi l'hora en la que es celebrarà el primer partit", "Registre de l'hora")

dobl = total / 4

         i = 0

         dobles = 6

         For i = i + 6 To dobl + 5

         Worksheets("torneig").Range("B" & i).Value = hora + i - 6 & ":00"

         Worksheets("torneig").Range("E" & i).Value = "vs"

         Worksheets("torneig").Range("C" & i).Value = "Dobles"

         Worksheets("torneig").Range("D" & i).Value = Worksheets("LlistaAleatoria").Range("A" & dobles).Value & " / " & Worksheets("LlistaAleatoria").Range("A" & dobles + 1).Value

         Worksheets("torneig").Range("F" & i).Value = Worksheets("LlistaAleatoria").Range("A" & dobles + 2).Value & " / " & Worksheets("LlistaAleatoria").Range("A" & dobles + 3).Value

         dobles = dobles + 4

          Next

    End If

Else

MsgBox ("El valor introduït és incorrecte.")

End If

End Sub

Sub borrar()

Call comptadornens

If Worksheets("LlistaAleatoria").Range("A6").Value <> "" Then

i = 0

For i = i + 6 To total + 6

Worksheets("LlistaAleatoria").Range("A" & i).Value = ""

Worksheets("Torneig").Range("b" & i).Value = ""

Worksheets("Torneig").Range("c" & i).Value = ""

Worksheets("Torneig").Range("d" & i).Value = ""

Worksheets("Torneig").Range("e" & i).Value = ""

Worksheets("Torneig").Range("f" & i).Value = ""

Next

End If

End Sub

Related entries: