Excel ¤ËÉÕ°¤¹¤ë¡¡Visual Basic Editer
3ÆüÌÜ
»°Âò¤ÎÀâÌÀ
´Êñ¤Ê¥×¥í¥°¥é¥à¤òºî¤ì¤ë¤è¤¦¤Ë²òÀ⤷¤Þ¤¹
¤³¤³¤Ç¤Ï¥ß¥Ë¥×¥í¥°¥é¥à¤ÎºîÀ®²áÄø¤òÂ賤·¤Æ¤¯¤À¤µ¤¤¡£
¥é¥Ù¥ë¤ò»ÈÍѤ·¤Æ¥³¥á¥ó¥È¤òÆþ¤ì¤Þ¤·¤¿¡£

¥»¥ë¤ËÌäÂêʸ¤òÆþ¤ì¤ë¡¡»ÈÍÑ¡¡
A¡¡B¡¡C¡¡D¡¡E¡¡F
cells¡Êx,1¡Ë...A ÌäÂêʸ
cells¡Êx,1¡Ë...B ¥À¥ß¡¼Àµ²ò
cells¡Êx,1¡Ë...C¡¡Àµ²ò
cells¡Êx,1¡Ë...D¡¡¥À¥ß¡¼Àµ²ò
cells¡Êx,1¡Ë...E¡¡Àµ²òÈÖ¹æ¤Ï£²
cells¡Êx,6¡Ë...F¡¡½ÐÂê¼Ô̾

ÀâÌÀ
Dim x, y, z, w, flag
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
|
¶¦Ä̤ǻÈÍѤ¹¤ëÊÑ¿ôÄêµÁ
¥³¥Þ¥ó¥É¥Ü¥¿¥ó£±¤ò²¡¤·¤¿¤È¤
¤³¤Î¥ë¡¼¥Á¥ó¤ò£°¤Î»þÄ̲ᤵ¤»¤ë
¥ª¥×¥·¥ç¥ó¥Ü¥¿¥ó£±¤Î»þy=1¤È¤¹¤ë
¥ª¥×¥·¥ç¥ó¥Ü¥¿¥ó£±¤Î»þy=£²¤È¤¹¤ë
¥ª¥×¥·¥ç¥ó¥Ü¥¿¥ó£±¤Î»þy=£³¤È¤¹¤ë
Àµ²òÈÖ¹æ¤Èy¤ÎÃͤ¬Æ±¤¸¤Ê¤é
¥Æ¥¥¹¥È¥Ü¥Ã¥¯¥¹£±¤ËÀµ²ò¤Ç¤¹É½¼¨
Àµ²ò¿ô¤Î¥«¥¦¥ó¥È1Áý²Ã
¥Æ¥¥¹¥È¥Ü¥Ã¥¯¥¹£³¤ËÀµ²ò¿ô¤òɽ¼¨
Àµ²òÈÖ¹æ¤Èy¤ÎÃͤ¬°Û¤Ê¤ë¤È¤
¥»¥ë5¤ÎÀµ²òÈÖ¹æ¤Ë1¤¹¤È¥»¥ë¤ÎÀµ²ò̾¾Î¤ÈƱ¤¸¤Ë¤Ê¤ë¤Î¤Ç¤³¤ì¤ò¥Æ¥¥¹¥È¥Ü¥Ã¥¯¥¹£±¤Ëɽ¼¨
Ä̲áµö²Ä
¥³¥Þ¥ó¥É¥Ü¥¿¥ó£±½ª¤ï¤ê
¥³¥Þ¥ó¥É¥Ü¥¿¥ó£²¤ò²¡¤·¤¿¤È¤
¥»¥ëG¤Ë¥¼¥í¤ò½ñ¤¹þ¤à
ÌäÂ꤬½ÐÂꤵ¤ì¤¿¤é¤³¤ÎÃͤò1¤È¤·¤Æ
Ʊ¤¸ÌäÂ꤬½Ð¤Ê¤¤¤è¤¦¤Ë¤¹¤ë¤¿¤á
¥æ¡¼¥¶¡¼¥Õ¥©¡¼¥à¤ò¥¯¥ê¥Ã¥¯¤·¤¿¾ì¹ç
£±¤«¤é100¤Þ¤Ç¤ÎÍð¿ô¤òȯÀ¸¤µ¤»¤ë
ÌäÂ꤬¤Þ¤À1²ó¤â½ÐÂꤵ¤ì¤Æ¤¤¤Ê¤«¤Ã¤¿¤é
½ÐÂꤷ¤¿¾Úµò¤ËG¤ò£±¤Ë¤¹¤ë
¥Æ¥¥¹¥È¥Ü¥Ã¥¯¥¹1¤Ë¥»¥ëAÎó¤ÎÌäÂêʸ¤òɽ¼¨¤¹¤ë¡£
¥Á¥Ã¥¯¥Ü¥Ã¥¯¥¹£±¤Ë²òÅú¤òɽ¼¨
¥Á¥Ã¥¯¥Ü¥Ã¥¯¥¹£²¤Ë²òÅú¤òɽ¼¨
¥Á¥Ã¥¯¥Ü¥Ã¥¯¥¹£³¤Ë²òÅú¤òɽ¼¨
½ÐÂê¿ô¤Î¥«¥¦¥ó¥È1Áý²Ã
100Ìä¤Þ¤Ç¤¤¤Ã¤¿¤é½ª¤ï¤ê
¥Æ¥¥¹¥È¥Ü¥Ã¥¯¥¹2¤Ë½ÐÂê¿ô¤òɽ¼¨
¥Æ¥¥¹¥È¥Ü¥Ã¥¯¥¹£´¤Ë½ÐÂê¼Ô¤òɽ¼¨
Ä̲á¥Õ¥é¥Ã¥°¤ò£°¤Ë¤¹¤ë
|
Ecxel¡¡2007¥µ¥ó¥×¥ë
Ecxel¡¡2003¥µ¥ó¥×¥ë