Sub kujund1() ' ' kujund1 Macro ' Macro recorded 21.11.02 by Arvutiklass P415 ' ' Keyboard Shortcut: Ctrl+k ' ActiveSheet.Shapes.AddShape msoShapeOval, 153#, 63.75, 171.75, 135# ActiveSheet.Shapes.AddShape(msoShapeOval, 194.25, 90.75, 27#, 24.75).Select ActiveSheet.Shapes.AddShape(msoShapeOval, 246#, 90#, 38.25, 27#).Select ActiveSheet.Shapes.AddLine(231#, 110.25, 231.75, 153.75).Select End Sub Sub kujund2() ActiveSheet.Shapes.AddShape msoShapeRectangle, 10, 10, 50, 50 End Sub Sub kujund3() Dim ring As Shape Set ring = ActiveSheet.Shapes.AddShape(msoShapeOval, 20, 10, 5, 5) ring.Fill.ForeColor.RGB = RGB(200, 150, 150) End Sub Sub kustutaKujundid() For Each kujund In ActiveSheet.Shapes kujund.Delete Next kujund End Sub Sub arvuleVastavJoon() kustutaKujundid ActiveSheet.Shapes.AddLine 100, 100, Range("b1") + 100, 100 End Sub Sub ovaalid() Dim lahter As Range kustutaKujundid For Each lahter In Selection paremserv = lahter.Left + lahter.Width ylaserv = lahter.Top If IsNumeric(lahter) Then ActiveSheet.Shapes.AddShape msoShapeOval, _ paremserv, ylaserv, lahter.Value, lahter.Height End If Next lahter End Sub Sub joonistaJuku(vasak, yla, laius, korgus) Dim s As Shapes Set s = ActiveSheet.Shapes s.AddShape msoShapeOval, vasak + laius / 4, yla, laius / 2, korgus / 6 'pea s.AddLine vasak + laius / 2, yla + korgus / 6, vasak + laius / 2, yla + korgus / 2 'keha s.AddLine vasak, yla + korgus / 2, vasak + laius / 2, yla + korgus / 4 'käsi s.AddLine vasak + laius, yla + korgus / 2, vasak + laius / 2, yla + korgus / 4 'käsi s.AddLine vasak, yla + korgus, vasak + laius / 2, yla + korgus / 2 'jalg s.AddLine vasak + laius, yla + korgus, vasak + laius / 2, yla + korgus / 2 End Sub Sub joonistustest() kustutaKujundid joonistaJuku 100, 50, 30, 100 joonistaJuku 150, 50, 30, 100 End Sub Sub jukula() Dim lahter As Range vasak = 100 Const vahe = 50 kustutaKujundid ActiveSheet.Shapes.AddShape msoShapeRectangle, vasak, 100, Selection.Cells.Count * vahe, 200 For Each lahter In Selection joonistaJuku vasak, 300 - lahter.Value, 30, lahter.Value vasak = vasak + vahe Next lahter End Sub