How to auto fill a range of cells with date?
To auto fill range of cells can be done via VBA or manually.
To manually fill a range of cells with date.
Type two dates on two cells and highlight the two cells and manually drag to the desired range of cells.
Drag from the bottom right with the "+" sign on it.
See screen shot below:
To do it via VBA is quite simple also using autofill function.
Sub AutoFill_Dates()
Dim srcRange As Range
Dim destRange As Range
Set srcRange = ActiveSheet.Range("E1") 'E1 should have valid date value
Set destRange = ActiveSheet.Range("E1:E15") 'E1 to E15 will be filled with the dates (starting the date specified on E1)
srcRange.AutoFill destRange, xlFillSeries 'xlFillSeries will auto fill the dates in sequence
End Sub
Cheers.. Hope it helps..
Comments
Post a Comment