李岳勳VBA雙迴圈LOOP與JavaScript迴圈VBA AddShape
畫圖畫面
畫圖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 = "李岳勳"
.Interior.Color = RGB(0, 0, 255)
With .Font
.Size = 16
.Bold = True
.Color = RGB(255, 255, 255)
End With
End With
End Sub
JavaScript雙迴圈
輸出
EXCEL VBA雙迴圈
Public Sub 留任倉() Cells(1, 1).Value = "留任倉超級" Cells(1, 1).Font.Size = 20 Cells(1, 1).Interior.Color = RGB(128, 0, 0) Cells(1, 1).Font.Color = RGB(255, 255, 255) End Sub Public Sub 留任倉迴圈() For i = 2 To 10 For j = 1 To 6 Cells(i, j).Value = (2010 + i) & "年" & k & "月" Next Next End Sub
留言
張貼留言