Dear all,
Thanks for your help!
2012/5/17 dguillett1
> Sub dates()
> days = Day(DateSerial(Year(Date), myMonth + 1, 1) - 1)
> MsgBox days
> Set myrange = Range("b1: b”& days)
> With myrange.Cells(1)
> .Value = DateSerial(Year(Date), Month(Date), 1)
> .AutoFill Destination:=myrange, Type:=xl
Sub dates()
days = Day(DateSerial(Year(Date), myMonth + 1, 1) - 1)
MsgBox days
Set myrange = Range("b1: b”& days)
With myrange.Cells(1)
.Value = DateSerial(Year(Date), Month(Date), 1)
.AutoFill Destination:=myrange, Type:=xlFillDays
End With
End Sub
Don Guillett
Microsoft MVP Excel
SalesAid Softwa
Hi,
First you Can give Name ranges instead of Static Range like B1:B31
Second :
You can create a Function for these lines to reduce the Lines from your code
With myrange.Cells(1)
.Value = DateSerial(Year(Date), month(Date), 1)
.AutoFill Destination:=myrange, Type:=xlFi