Sub poczatek() Dim a, b, c As Integer Range("a1").Offset(7, 0).Value = Int(Rnd * 100) 'losowanie a = Val("a1") Label1.Caption = "wylosowano. podaj liczbę" End Sub
Private Sub CommandButton1_Click() b = Val(TextBox1.Text) If a = b Then Label1.Caption = "You are a winner!" Else If a > b Then Label1.Caption = "za mało" Else Label1.Caption = "za dużo" End If End If End Sub 'Dim x As Integer 'If x = 5 Then
'Else ' For x = 0 To 5 ' Range("a1").Offset(x, 0).Value = TextBox1.Text ' Next x 'End If