KutoolsforOffice— 1 つのソリューション、5 つの強力なツール。少ない労力で大きな成果。

Excel でカレンダーを作成するには、どうすればよいですか?

著者テクニカルサポート変更日

Excel カレンダーを使えば、誰かが新しい仕事を始める日や納品期限など、重要なイベントを簡単に把握できます。これらの日付が明確かつ一目で確認できるようになります。このガイドでは、Excel で月間および年間カレンダーを作成する方法をご紹介します。テンプレートを使った手軽な設定法と、細かいカスタマイズをしたい方向けのゼロからの作成法の両方を解説。これにより、仕事でもプライベートでも、しっかり整理されたスケジュール管理が実現できます。

カレンダーを作成

Excel カレンダーテンプレートを使用して年間カレンダーを作成します

Kutools for Excel を使って月間または年間カレンダーを素早く作成できます

VBA コードで月間カレンダーを作成します


Excel カレンダーテンプレートを使用して年間カレンダーを作成します

この方法を使うには、コンピューターがネットワークに接続されていることを確認し、カレンダーテンプレートをダウンロードできるようにしてください。

1。まずは「ファイル」タブに移動し、左側のペインで「新規作成」ボタンをクリックしてください。その後、「カレンダー」を「おすすめの検索」から選択します。スクリーンショットを参照してください:

[新規]ボタンをクリックし、[カレンダー]をクリック

2。お気に入りのカレンダーテンプレートを1 つ選び、ダブルクリックして年間カレンダーを作成しましょう。

 カレンダーテンプレートのいずれかを選択

結果

カレンダーが挿入されます


Kutools for Excel を使って月間または年間カレンダーを素早く作成できます

永久カレンダーKutools for Excelツールを使えば、新しいワークブックにカスタマイズされた月間または年間カレンダーを瞬時に作成でき、各月のカレンダーはそれぞれ新しいワークシートに配置されます。

Kutools for Excelkutools for Excel は高度な機能を300 以上提供し、複雑な作業を効率化して創造性と生産性を高めます。AI 機能を統合したkutools for Excel は、正確にタスクを自動化し、データ管理を簡単にします。Kutools for Excel の詳細情報。。。         無料トライアル。。。

Kutools for Excel をインストール後、「KUTOOLS PLUS > ワークシート > 永久カレンダー」をクリックしてください。表示される永久カレンダーダイアログボックスで、以下の操作を行ってください:

  • 月間カレンダーを作成するには、開始および終了のドロップダウンリストで作成したい月を指定し、作成をクリックしてください。

月次カレンダーを作成する月を指定

  • 年間カレンダーを作成するには、開始および終了のドロップダウンリストでカレンダーを作成したい年を指定し、作成をクリックしてください。

 年次カレンダーを作成する年を指定

結果
  • 月間カレンダー:

月次カレンダーが挿入されます

  • 年間カレンダー:

年次カレンダーが挿入されます

ヒント:この機能を使用するには、まずKutools for ExcelKUTOOLS PLUS をインストールする必要があります。今すぐダウンロードして30 日間の無料トライアルをお試しください。

VBA コードで月間カレンダーを作成します

次の VBA コードを使えば、月間カレンダーをスピーディに作成できます。以下の手順に従ってください:

1。Microsoft Visual Basic for Applications ウィンドウを開くには、「Alt+F11」キーを押してください。

2。新しいウィンドウが表示されたら、「挿入>標準モジュール」をクリックして、モジュールに以下のコードを入力します:

 Sub CalendarMaker()
ActiveSheet.Protect DrawingObjects:=False, Contents:=False, _
Scenarios:=False
Application.ScreenUpdating = False
On Error GoTo MyErrorTrap
Range("a1:g14").Clear
MyInput = InputBox("Type in Month and year for Calendar ")
If MyInput = "" Then Exit Sub
StartDay = DateValue(MyInput)
If Day(StartDay) <> 1 Then
StartDay = DateValue(Month(StartDay) & "/1/" & _
Year(StartDay))
End If
Range("a1").NumberFormat = "mmmm yyyy"
With Range("a1:g1")
.HorizontalAlignment = xlCenterAcrossSelection
.VerticalAlignment = xlCenter
.Font.Size = 18
.Font.Bold = True
.RowHeight = 35
End With
With Range("a2:g2")
.ColumnWidth = 11
.VerticalAlignment = xlCenter
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlCenter
.Orientation = xlHorizontal
.Font.Size = 12
.Font.Bold = True
.RowHeight = 20
End With
Range("a2") = "Sunday"
Range("b2") = "Monday"
Range("c2") = "Tuesday"
Range("d2") = "Wednesday"
Range("e2") = "Thursday"
Range("f2") = "Friday"
Range("g2") = "Saturday"
With Range("a3:g8")
.HorizontalAlignment = xlRight
.VerticalAlignment = xlTop
.Font.Size = 18
.Font.Bold = True
.RowHeight = 21
End With
Range("a1").Value = Application.Text(MyInput, "mmmm yyyy")
DayofWeek = Weekday(StartDay)
CurYear = Year(StartDay)
CurMonth = Month(StartDay)
FinalDay = DateSerial(CurYear, CurMonth + 1, 1)
Select Case DayofWeek
Case 1
Range("a3").Value = 1
Case 2
Range("b3").Value = 1
Case 3
Range("c3").Value = 1
Case 4
Range("d3").Value = 1
Case 5
Range("e3").Value = 1
Case 6
Range("f3").Value = 1
Case 7
Range("g3").Value = 1
End Select
For Each cell In Range("a3:g8")
RowCell = cell.Row
ColCell = cell.Column
If cell.Column = 1 And cell.Row = 3 Then
ElseIf cell.Column <> 1 Then
If cell.Offset(0, -1).Value >= 1 Then
cell.Value = cell.Offset(0, -1).Value + 1
If cell.Value > (FinalDay - StartDay) Then
cell.Value = ""
Exit For
End If
End If
ElseIf cell.Row > 3 And cell.Column = 1 Then
cell.Value = cell.Offset(-1, 6).Value + 1
If cell.Value > (FinalDay - StartDay) Then
cell.Value = ""
Exit For
End If
End If
Next
For x = 0 To 5
Range("A4").Offset(x * 2, 0).EntireRow.Insert
With Range("A4:G4").Offset(x * 2, 0)
.RowHeight = 65
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlTop
.WrapText = True
.Font.Size = 10
.Font.Bold = False
.Locked = False
End With
With Range("A3").Offset(x * 2, 0).Resize(2, _
7).Borders(xlLeft)
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
With Range("A3").Offset(x * 2, 0).Resize(2, _
7).Borders(xlRight)
.Weight = xlThick
.ColorIndex = xlAutomatic
End With
Range("A3").Offset(x * 2, 0).Resize(2, 7).BorderAround _
Weight:=xlThick, ColorIndex:=xlAutomatic
Next
If Range("A13").Value = "" Then Range("A13").Offset(0, 0) _
.Resize(2, 8).EntireRow.Delete
ActiveWindow.DisplayGridlines = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True, _
Scenarios:=True
ActiveWindow.WindowState = xlMaximized
ActiveWindow.ScrollRow = 1
Application.ScreenUpdating = True
Exit Sub
MyErrorTrap:
MsgBox "You may not have entered your Month and Year correctly." _
& Chr(13) & "Spell the Month correctly" _
& " (or use 3 letter abbreviation)" _
& Chr(13) & "and 4 digits for the Year"
MyInput = InputBox("Type in Month and year for Calendar")
If MyInput = "" Then Exit Sub
Resume
End Sub 

3。次に、「実行」ボタンをクリックするか、「F5」キーを押してアプリケーションを実行してください。すると、プロンプトボックスが表示されるので、空欄に月と年を入力してください。

 テキストボックスに月と年を入力

結果

 月次カレンダーが挿入されます