Sub FillSelectedWeek()
'
' FillSelectedWeek Macro
'
Validcells = Array("B4", "B15", "B26", "B37", "B48", "B59", "B70", "B81", "B92", "B103", "B114", "B125", "B136", "B147", "B158", "B169", "B180", "B191", "B202", "B213", "B224", "B235", "B246", "B257", "B268", "B279", "B290", "B301", "B312", "B323", "B334", "B345", "B356", "B367", "B378", "B389", "B400", "B411", "B422", "B433", "B444", "B455", "B466", "B477", "B488", "B499", "B510", "B521", "B532", "B543", "B554", "B565", "B576")
If Not IsNumeric(Application.Match(Replace(ActiveCell.Address, "$", ""), Validcells, 0)) Then Exit Sub
ActiveCell.Offset(2, 1).Range("A1:A8").Select
Selection.AutoFill Destination:=ActiveCell.Range("A1:F8"), Type:= _
xlFillValues
ActiveCell.Range("A1:F8").Select
ActiveCell.Offset(0, 1).Range("A1:E8").Select
With Selection.Validation
.Delete
.Add Type:=xlValidateInputOnly, AlertStyle:=xlValidAlertStop, Operator _
:=xlBetween
.IgnoreBlank = True
.InCellDropdown = True
.ShowInput = True
.ShowError = True
End With
End Sub
Bookmarks