發表文章

目前顯示的是 11月, 2021的文章

吳睿捷VBA雙迴圈Loop與JavaScript

圖片
  畫圖畫面 畫圖VBA程式碼 Rem http://excelatfinance.com/xlfl9/xlf-qg-add-blue-circle.php Rem 2021/11/29吳睿捷提示 Option Explicit Const topleft As String = "C5"  ' anchor cell Const diam As Integer = 100     ' points宣告常數constant變數diameter直徑radius半徑 Dim Shp As Shape  '宣告dim 變數Shp是圖形Shape  global Sub 吳睿捷刪除()   For Each Shp In ActiveSheet.Shapes      Shp.Delete '刪除使用中試算表ActiveSheet的所有圖形Shapes   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 '往下的方向出現物件addshape增加圖形type mso微軟           Set Shp = ActiveSheet.Shapes.AddShape(Type:=msoShapeOval, _                                               Left:=x, Top...

吳睿捷VBA雙迴圈Loop與JavaScript迴圈

圖片
輸出 Excel學習 Option Explicit      '必須宣告所有變數variables Dim i, j As Integer '宣告dimension i, j 是整數integer Public Sub RayWu()   Cells(1, 1).Value = "RayWu xxx"   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 RayWu迴圈()    For i = 2 To 10       For j = 1 To 6         Cells(i, j).Value = (2010 + i) & "年"     Next    Next End Sub

VBA巨集Macro程式設計

圖片
Public Sub 劉任昌第一個城市() '練習寫迴圈 VBA=Visual Basic Application 'Dim i, j As Integer j = 7 For i = 1 To 15 Cells(i, j).Value = i * i Next 'VBA迴圈的結束Next, C或Javascript {}定義迴圈範圍 'VBA程式語言寫Microsoft Office 巨集 Macro小程式 End Sub 只顯示部分資訊