Excel ¤ËÉÕ°¤¹¤ë¡¡Visual Basic Editer
2ÆüÌÜ
»°Âò¥²¡¼¥à¤òºî¤ë
´Êñ¤Ê¥×¥í¥°¥é¥à¤òºî¤ì¤ë¤è¤¦¤Ë²òÀ⤷¤Þ¤¹
¤³¤³¤Ç¤Ï¥ß¥Ë¥×¥í¥°¥é¥à¤ÎºîÀ®²áÄø¤òÂ賤·¤Æ¤¯¤À¤µ¤¤¡£
¥»¥ë¤ËÌäÂêʸ¤òÆþ¤ì¤ë¡¡»ÈÍÑ¡¡
A¡¡B¡¡C¡¡D¡¡E¡¡F
cells¡Ê1,1¡Ë...A
cells¡Ê1,6¡Ë...F
100Ìäºî¤ê¤Þ¤·¤¿
¥Õ¥©¡¼¥à¤òºî¤ê¤Þ¤¹
¥Õ¥©¡¼¥à¤È¥³¥Þ¥ó¥É¥Ü¥¿¥ó¡¡£±¡¡¤È¡¡£²¡¡¤ò¥¯¥ê¥Ã¥¯¤·¤Æ¤«¤é
Private Sub CommandButton1_Click()
If flag = 0 Then
If OptionButton1 = True Then y = 1
If OptionButton2 = True Then y = 2
If OptionButton3 = True Then y = 3
If Cells(x, 5) = y Then
TextBox1 = "Àµ²ò¤Ç¤¹"
w = w + 1
TextBox3 = w
Else
TextBox1 = Cells(x, Cells(x, 5) + 1)
End If
End If
flag = 1
End Sub
Private Sub CommandButton2_Click()
For j = 1 To 100
Cells(j, 7) = 0
Next j
End Sub
Private Sub UserForm_Click()
x = Int(Rnd() * 100) + 1
If Cells(x, 7) = 0 Then
Cells(x, 7) = 1
TextBox1 = Cells(x, 1)
OptionButton1.Caption = Cells(x, 2)
OptionButton2.Caption = Cells(x, 3)
OptionButton3.Caption = Cells(x, 4)
z = z + 1
If z = 100 Then Stop
TextBox2 = z
TextBox4 = Cells(x, 6)
flag = 0
End If
End Sub
¼Â¹Ô¤·¤Þ¤¹¡¡»°³Ñ¤Î¼Â¹Ô¥Ü¥¿¥ó
form¤ò¥¯¥ê¥Ã¥¯¤·¤ÆÌäÂê¤ò½Ð¤¹
Àµ²ò¤òÁª¤Ö
¥³¥Þ¥ó¥É¥Ü¥¿¥ó£±¤ò²¡¤·¤ÆÅú¤¨¤Î³Îǧ
¼¡¤Ë¿Ê¤à
form¤ò¥¯¥ê¥Ã¥¯¤·¤ÆÌäÂê¤ò½Ð¤¹
¤³¤³¤Ç¤Ï¡¡Ã»¤¤¥ê¥¹¥È¤Ç¤ª¤â¤·¤í¤¤¥²¡¼¥à¤¬¤Ç¤¤ë¤è¤¦¤Ë¡¢¤Þ¤¿¥»¥ë¤ÈϢư¤·¤Æʬ¤«¤ê¤ä¤¹¤¤¥×¥í¥°¥é¥à¤Ë¤·¤¿¤Ä¤â¤ê¤Ç¤¹¡£