Option Explicit '必須宣告所有變數variables Dim i, j As Integer '宣告dimension i, j 是整數integer 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) & "年" & j & "月" Next Next End Sub JavaScript雙迴圈 輸出