|
本帖最后由 wlianke 于 2011-12-11 19:29 编辑
能不能让我们的shape对象如动画般旋转起来呢?该程序可以做到,非常有趣哦!!
代码如下:
Public Sub shapespin()
Dim myshape As Shape
Dim ws As Worksheet
Dim i As Long
Dim j As Long
Set ws = Worksheets(1)
With ws
For Each myshape In .Shapes
myshape.Delete
Next
Set myshape = .Shapes.AddShape(Type:=msoShape5pointStar, Left:=120, Top:=80, Width:=80, Height:=80)
End With
With myshape
For i = 1 To 3000 Step 5
.Top = Sin(i * (3.1416 / 180)) * 100 + 100
.Left = Cos(i * (3.1416 / 180)) * 100 + 100
.Fill.ForeColor.RGB = i * 100
For j = 1 To 10
.IncrementRotation -2
DoEvents
Next j
Next i
End With
End Sub
旋转的shape.rar
(11.16 KB, 下载次数: 436)
该贴已经同步到 wlianke的微博 |
评分
-
1
查看全部评分
-
|