輸出 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
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 只顯示部分資訊
留言
張貼留言