EXCEL VBA,呈現畫面如附件。當我在總表的A1與B1,分別輸入年與月。希望按一顆按鍵後,能從"總表"的D6開始,依序顯示出13個月份排列(輸入當月的前13個月),希望能有摘要說明,能讓小弟未來能做修改,感謝。?

2016-05-08 8:13 am

回答 (1)

2016-05-08 2:26 pm
✔ 最佳答案
Private Sub CommandButton1_Click()
x = Cells(1, 2)
y = Cells(1, 1)
For i = 16 To 4 Step -1
If x = 0 Then
x = 12
y = y - 1
End If
Cells(6, i) = y & Format(x, "00")
x = x - 1
Next
End Sub


收錄日期: 2021-05-03 13:45:14
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20160508001314AAqOvF5

檢視 Wayback Machine 備份