畫圖畫面 畫圖VBA程式碼 Option Explicit Const topleft As String = "C5" 'anchor cell Const diam As Integer = 180 ' points Dim Shp As Shape '宣告dim 變數Shp是圖形Shape global Sub 李岳勳刪除() For Each Shp In ActiveSheet.Shapes Shp.Delete '刪除使用中試算表ActiveSheet的所有徒刑 Next End Sub Sub 李岳勳() Dim Shp As Shape '宣告變數Shp是徒刑 Dim x As Double '宣告變數X是被精度時數Double Dim y As Double '宣告變數y是被精度時數Double Dim i As Integer '宣告變數i是整數Double For i = 1 To 20 '寫迴圈 x = 20 y = 20 * i Set Shp = ActiveSheet.Shapes.(Type:=msoShapeOval, _ Left:=x, Top:=y, _ Width:=diam, Height:=diam) With Shp .Fill.Visible = msoFalse .Line.Weight = 10 .Line.ForeColor.Brightness = 0.4 .ThreeD.BevelTopType = msoBevelCircle End With Next With Cells(1, 1) 'with 固定前面的物件end with .Value = "李岳勳...
留言
張貼留言