Const hisu As Integer = 31 '作成する日付数 Const cend As Integer = 5 '作成行 Const cm As Integer = 3 'スタ−ト列 Sub ki143() Sheets("Sheet1").Select '基点の日付指定 Range(Cells(1, cm), Cells(1, hisu + cm)).Select Selection.NumberFormat = "m/d" Cells(1, cm).Select hia = InputBox("「月/日」を入力して下さい", "基点月/日指定") If hia = "" Then Exit Sub End If If Val(hia) = 0 Then MsgBox "日付を入力して下さい" Exit Sub End If Cells(1, cm) = hia hia = Cells(1, cm) '月/日記入。 For i = 1 To hisu Cells(1, i + cm) = hia + i Next ' Range(Cells(1, cm), Cells(1, hisu + cm)).Select Selection.Copy Range(Cells(2, cm), Cells(cend, hisu + cm)).Select ActiveSheet.Paste '曜日記入 Range(Cells(2, cm), Cells(2, hisu)).Select Selection.NumberFormat = "aaa" Range("A1").Select '日曜日色づけ For i = cm To hisu ccc = Cells(2, i).Text If InStr(1, ccc, "日") > 0 Then Cells(2, i).Interior.ColorIndex = 38 End If If InStr(1, ccc, "土") > 0 Then Cells(2, i).Interior.ColorIndex = 36 End If Next End Sub Sub ki143a() Sheets("Sheet1").Select Cells.Select Selection.ClearContents Selection.Interior.ColorIndex = xlNone Range("A1").Select Sheets("Title").Select End Sub