vbaの質問です。
じゃんけんゲームをユーザフォームを使い作ろうとしています。
Private Sub CommandButton1_Click() Dim tejj As Long Dim h As Long, g As Long, k As Long TextBox1 = "じゃんけん開始" h = 0 g = 0 k = 0 tejj = Int(Rnd() * 3 + 1) If CheckBox1.Value = True And tejj = 1 Then MsgBox "あいこでしょ" g = g + 1 ElseIf CheckBox1.Value = True And tejj = 2 Then MsgBox "あなたの勝ちです。
" h = h + 1 ElseIf CheckBox1.Value = True And tejj = 3 Then MsgBox "あなたの負けです。
" k = k + 1 ElseIf CheckBox2.Value = True And tejj = 1 Then MsgBox "あなたの負けです" k = k + 1 ElseIf CheckBox2.Value = True And tejj = 2 Then MsgBox "あいこでしょ" g = g + 1 ElseIf CheckBox2.Value = True And tejj = 3 Then MsgBox "あなたの勝ちです" h = h + 1 ElseIf CheckBox3.Value = True And tejj = 1 Then MsgBox "あなたの勝ちです。
" h = h + 1 ElseIf CheckBox3.Value = True And tejj = 2 Then MsgBox "あなたの負けです" k = k + 1 ElseIf CheckBox3.Value = True And tejj = 3 Then MsgBox "あいこでしょ。
" g = g + 1 End If TextBox2.Text = h TextBox3.Text = g TextBox4.Text = k End Sub ここまで作りましたが、 私は勝ちなら勝ちに1増やすなどしたいです。
集計や分析などを作りたいのですが、 ここからどうしたらいいのか教えてください。
初心者なので細部まで教えてくださるとありがたいです。
お願いします。
As
に関する質問