Skip to content

Instantly share code, notes, and snippets.

@Myoga1012 Myoga1012/Calendar.vb
Last active Aug 29, 2015

Embed
What would you like to do?
Excelのワークシートにカレンダー出力するVBAのモジュールです。
' 名前 : Myoga Screw-bright (旧名:Myoga S. Tomonaka)
' Twitter : https://twitter.com/Myoga1012
Sub Calendar()
Dim now As Date
now = Date
Dim iday As Date
iday = DateSerial(Year(now), Month(now), 1)
Dim seq As Integer
seq = Weekday(iday) - 1
Range("A1", "A6").Font.ColorIndex = 3
Range("G1", "G6").Font.ColorIndex = 5
Do
Cells(seq \ 7 + 1, seq Mod 7 + 1).Value = day(iday)
iday = DateAdd("D", 1, iday)
seq = seq + 1
Loop While Month(iday) = Month(now)
End Sub
' Calender.vb ( ExcelのVBA用 )
' Copyright (c) 2014 Myoga-TN.net All Rights Reserved.
' This software is released under the MIT License.
' http://opensource.org/licenses/mit-license.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.