Sub AutoDateFill()
Dim x As Date
Dim rn As Long
Dim cn As String, sn As Long
cn = InputBox("Which Column to fill?")
rn = InputBox("How many rows to fill?")
sn = InputBox("Which row to start fill?")
Application.ScreenUpdating = False
Application.StatusBar = "Macro Running"
x = InputBox("What is the starting Date? mm/dd/yyyy")
Range(cn & sn).Select
Do Until ActiveCell.Row = rn + sn
If ActiveCell.EntireRow.Hidden = False Then
ActiveCell.Value = x
x = x + 1
End If
ActiveCell.Offset(1).Select
Loop
Application.ScreenUpdating = True
Application.StatusBar = "Completed"
End Sub
Cell Formulas | ||
---|---|---|
Range | Formula | |
B6:B16 | B6 | =SUM(B5,14) |
D5:D16 | D5 | =TEXT(B5,"mmmm d-") & TEXT(B5+13,"d, yyyy") |