|
>Worksheet_Changeイベントでできます。
ありがとうございます。
やってみましたが、うまくいきません。
何処が悪いでしょうか?
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rg As Range
Dim rgall As Range
Dim themonth As Integer
Dim theyear As Integer
Dim days As Integer
Range("a4:a35").ClearContents
theyear = Range("a1").Value
themonth = Range("b1").Value
Set rg = Range("a4")
days = Day(DateSerial(theyear, themonth + 1, 1) - 1)
rg.Value = DateSerial(theyear, themonth, 1)
Set rgall = Range(rg, rg.Offset(days - 1, 0))
Range("a4").AutoFill Destination:=rgall, Type:=xlFillDays
Set rg = Nothing
Set rgall = Nothing
End Sub
|
|