財金程式設計113加入刪除sub
Option Explicit
Const topleft As String = "C5" ' anchor cell
Const diam As Integer = 100 ' points
Dim Shp As Shape
Sub 張博宇刪除()
For Each Shp In ActiveSheet.Shapes
Shp.Delete
Next
End Sub
' ===========================
Sub 張博宇()
Dim Shp As Shape
Dim x As Double '宣告變數x是倍精度實數Double
Dim y As Double '宣告變數y是倍精度實數Double
Dim i As Integer '宣告變數是整數Integer
For i = 1 To 10 '寫迴圈
x = 20 * i
y = 20 * i
Set Shp = ActiveSheet.Shapes.AddShape(Type:=msoShapeOval, _
Left:=x, Top:=y, _
Width:=diam * 2, 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)
.Value = "張博宇A"
.Interior.Color = RGB(0, 0, 255)
With .Font
.Size = 24
.Color = RGB(255, 255, 255)
.Bold = True
End With
End With
End Sub
留言
張貼留言