- 52 名前:デフォルトの名無しさん mailto:sage [2024/04/09(火) 14:44:25.19 ID:EBugvdEwM.net]
- >>47
Sub 全自動で表を作るMacro1() Dim da As Date da = "1/1" 'この日からスタート ro = 2 For we = 1 To 52 '52週間分作る Cells(ro, 3).Resize(1, 3) = Array("a", "b", "c") For lo = 1 To 7 Cells(ro + lo, 2) = da da = da + 1 Next Set ra = Cells(ro, 2).Resize(8, 4) ra.Borders(xlEdgeLeft).LineStyle = xlContinuous ra.Borders(xlEdgeLeft).Weight = xlMedium ra.Borders(xlEdgeRight).LineStyle = xlContinuous ra.Borders(xlEdgeRight).Weight = xlMedium ra.Borders(xlEdgeTop).LineStyle = xlContinuous ra.Borders(xlEdgeTop).Weight = xlMedium ra.Borders(xlEdgeBottom).LineStyle = xlContinuous ra.Borders(xlEdgeBottom).Weight = xlMedium ra.Borders(xlInsideVertical).LineStyle = xlContinuous ra.Borders(xlInsideVertical).Weight = xlMedium ra.Borders(xlInsideHorizontal).LineStyle = xlContinuous ra.Borders(xlInsideHorizontal).Weight = xlMedium ro = ro + 8 Next Range("B:B").Font.Name = "MS 明朝" Range("C:E").Font.Name = "MS ゴシック" Range("B:E").Font.Bold = True Range("B:B").NumberFormatLocal = "m月d日 (aaa)" End Sub
|

|