發表文章

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

藍云妡EXCEL與Javascript迴圈

圖片
輸出 EXCEL學習 '變數variables應該要宣告 pre=preserve保留 Option Explicit '要求所有變數必須宣告才能使用 Dim i, j As Integer 'Dimension 宣告指令 Public Sub 劉任昌() Cells(1, 1).Value = 12345 Cells(1, 1).Font.Color = RGB(0, 0, 256) Cells(1, 1).Font.Bold = True End Sub Public Sub 豬八戒() For i = 1 To 7 For j = 1 To 5 Cells(i, j).Value = i * j Next Next End Sub 畫圖畫面 畫圖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 xlfAddCircle1() Dim TLCleft As Double 'local variables區域變數 Dim TLCtop As Double TLCleft = Range(topleft).Left TLCtop = Range(topleft).Top Set Shp = ActiveSheet.Shapes.AddShape(Type:=msoShapeOval, _ Left:=TLCleft, Top:=TLCtop, _ Width:=diam, Height:=diam) With Shp .Fill.Visible = ...

EXCEL基本功能

圖片
劉任昌107影片 我的EXCEL試算表 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