n 3 X n Y n = Z n 17 1995 300 n n 2 3 2 a b c c 2 a 2 b 2 600 2000 322 3 15 2 3 580 3 1 5 4 3 2 1 300 2 1 2 1
1 ExcelVBA 2 VBA 1 VBA 2 API Sleep ExcelVBA 2 100 60 80 50 ExcelVBA API Sleep 3 100 60 (80 50) 2 3 4 Step1 5 1 Try 5 4 VBA 5 2
Ctrl Btn1 Enter 5 Btn2 5 VBEditor s_step1 Step1 Sub s_step1() Dim i As Integer With Worksheets("Try") '***** Step1 **********.Shapes("Btn1").Visible = False A '***** *** With.Shapes.AddShape(msoShapeRightTriangle, 220, 110, 100, 70).Name = "Triangle".Fill.ForeColor.RGB = RGB(400, 200, 0).Flip msofliphorizontal '***** ***** With.Shapes.AddShape(msoShapeRectangle, 0, 58, 122, 122).Name = "SquareC".Fill.ForeColor.RGB = RGB(300, 150, 0) Do Until.Left > 98 C-1.IncrementLeft 1: DoEvents Loop For i = 1 To 55.IncrementRotation 1: DoEvents C- Next.IncrementTop -25 C- Do Until.Left > 173.IncrementLeft 1: DoEvents Loop '***** ******* With.Shapes.AddShape(msoShapeRectangle, 220, 300, 100, 100).Name = "SquareA".Fill.ForeColor.RGB = RGB(100, 200, 100) Do Until.Top < 180.IncrementTop -1: DoEvents Loop '***** ******* With.Shapes.AddShape(msoShapeRectangle, 370, 110, 70, 70).Name = "SquareB".Fill.ForeColor.RGB = RGB(100, 200, 200) Do Until.Left < 320.IncrementLeft -1: DoEvents B C D E 3
Loop '***** Step2.Shapes("Btn2").Visible = True End Sub F s_step1 Btn1 1 AddShape AddShape 1 Type msoautoshapetype AddShape Shapes Triangle Fill FillFormat C C 2 1 IncrementLeft IncrementTop C 1 1 DoEvents 6 2 IncrementRotatjon Z C 2 55 6 55 a 100 b 4
70 B C 3 D.E D E C 2 7 [s_step1] F Btn2 s_step1 Btn1 Step1 4 7 Step2 8 8 3 Step1 180 s_step2 Declare Sub Sleep Lib "kernel32" (BYVal dwmilliseconds As Long) 5
2 Step2 Sub s_step2() Dim i As Integer, j As Double With Worksheets("Try") '***** Step2 **********.Shapes("Btn2").Visible = False '***** ***********.Shapes("SquareA").Delete.Shapes("SquareB").Delete '***** ** Do Until.Shapes("Triangle").Top > 160.Shapes("SquareC").IncrementTop 1.Shapes("Triangle").IncrementTop 1 DoEvents Loop '***** *** With.Shapes.AddShape(msoShapeRightTriangle, 150, 130, 70, 100).Name = "Tri2" With.Shapes.AddShape(msoShapeRightTriangle, 150, 60, 100, 70).Flip msoflipvertical.name = "Tri3" With.Shapes.AddShape(msoShapeRightTriangle, 250, 60, 70, 100).Flip msoflipvertical.flip msofliphorizontal.name = "Tri4" A '***** ***** With.Shapes.Range(Array("Tri2", "Tri3", "Tri4")) A-1.Fill.ForeColor.RGB = RGB(200, 400, 100) For i = 0 To 5.Fill.Visible = Not.Fill.Visible A-2 s_timewait (300) Next '***** Step3.Shapes("Btn3").Visible = True End Sub Step2 2 3 A 2 6
1 ShapeRange Shapes Range ShapeRange Array A 1 2 Sleep 2 Win32API Sleep A 2 s_timewait Sleep 3 Sleep 300 Sleep Declare 3 '****** ' s_timewait ' mymsec '****** Sub s_timewait(mymsec As Long) DoEvents Sleep mymsec End Sub Step3 Step2 4 4 s_step3 4 Shapes OLE tri 4 9 Step2 ShapeRange 9 7
4 Step3 Sub s_step3() Dim myshape With Worksheets("Try") '***** Step3 **********.Shapes("Btn3").Visible = False '***** ***.Shapes("SquareC").ZOrder msosendtoback '***** ******* For Each myshape In.Shapes If Left$(myShape.Name, 3) = "Tri" Then myshape.flip msoflipvertical myshape.flip msofliphorizontal s_timewait (300) End If Next '***** Step4.Shapes("Btn4").Visible = True End Sub Step4 a 2 +b 2 Step3 4 a x b 2 4 2ab a b a 2 b 2 2ab a 2 b 2 s_step4 10 2 s_step4 5 8
10 9
5 Sub s_step4() Dim i As Integer Dim myshape With Worksheets("Try") '***** Step4 **********.Shapes("Btn4").Visible = False '***** * With.Shapes.AddShape(msoShapeRectangle, 370, 230, 30, 30).Fill.ForeColor.RGB = RGB(300, 150, 100) s_timewait (600) '***** 1.Shapes("Triangle").Delete s_timewait (400) With.Shapes.AddShape(msoShapeRightTriangle, 370, 60, 70, 100).Fill.ForeColor.RGB = RGB(200, 400, 100) s_timewait (600) '***** 2.Shapes("Tri2").Delete s_timewait (400) With.Shapes.AddShape(msoShapeRightTriangle, 370, 60, 70, 100).Fill.ForeColor.RGB = RGB(200, 400, 100).Flip msoflipvertical.flip msofliphorizontal s_timewait (600) '***** 3.Shapes("Tri3").Delete s_timewait (400) With.Shapes.AddShape(msoShapeRightTriangle, 440, 60, 70, 100).Fill.ForeColor.RGB = RGB(200, 400, 100).Flip msoflipvertical s_timewait (600) '***** 4.Shapes("Tri4").Delete s_timewait (400) With.Shapes.AddShape(msoShapeRightTriangle, 440, 60, 70, 100).Fill.ForeColor.RGB = RGB(200, 400, 100).Flip msofliphorizontal s_timewait (600) '***** *********** For Each myshape In.Shapes If myshape.type = msotextbox Then myshape.visible = True End If Next '***** Step5.Shapes("Btn5").Visible = True End 10
Step5 Step1 4 s_stepend 6 6 Sub s_stepend() Dim myshape With Worksheets("Try") '***** Step5 **********.Shapes("Btn5").Visible = False '***** ** For Each myshape In.Shapes If myshape.type = msoautoshape Then myshape.delete ElseIf myshape.type = msotextbox Then myshape.visible = False End If Next '***** Step1.Shapes("Btn1").Visible = True End Sub Shape Type Shapes Type msofomcontrol s_stepend Step1 Step1 2 100 1 ExcelVBA 11
12