d = MsgBox("入力しますか?", vbYesNo,) If d = vbYes Then y = TextBox1.Value i = DatePart("m", y) m = DatePart("d", y) j = 11 - i With Worksheets("sheet4") .Range("f65536").End(xlUp).Offset(0, 3) = i .Range("f65536").End(xlUp).Offset(0, 4) = m .Range("c65536").End(xlUp).Offset(1, 0) = i & "月" & m & "日" End With For k = h To j q = Worksheets("sheet4").Range("i65536").End(xlUp) With Worksheets("sheet4") .Range("f65536").End(xlUp).Offset(0, 3) = q + 1 .Range("f65536").End(xlUp).Offset(0, 4) = m .Range("c65536").End(xlUp).Offset(1, 0) = q + 1 & "月" & m & "日" End With Next Else