'ひと月分のシートをコピーし、 'シート名、シート色の設定を行う。 For targetDay = lastDay To firstDay + 1 Step -1 .Sheets("1日").Copy After:=Sheets("1日") .ActiveSheet.Tab.ColorIndex = xlNone .ActiveSheet.Range("B1").Value = targetDay .ActiveSheet.Name = Format(ActiveSheet.Range("B1").Value, "d日") If Not .Sheets("祝日").Cells.Find(targetDay, LookAt:=xlWhole) Is Nothing Or _ Weekday(targetDay) = vbSunday Then .ActiveSheet.Tab.ColorIndex = 3 End If Next