Like so... but you may want to take out the hardcoded color banding...replace with color banding applied through conditional formatting based on row #
Option Explicit
Sub MoveData()
Dim RNG As Range, cell As Range, NR As Long
On Error Resume Next
With Sheets("Engineering Schedule")
Set RNG = .Range("E:E").SpecialCells(xlConstants, 1)
NR = Sheets("Production Schedule").Range("E" & Rows.Count).End(xlUp).Row + 1
For Each cell In RNG
If IsDate(cell) And cell < Now Then
With .Range("A" & cell.Row).Resize(, 16)
Sheets("Production Schedule").Range("A" & NR).Resize(, 16).Value = .Value
NR = NR + 1
.ClearContents
End With
End If
Next cell
With .Sort
.SortFields.Clear
.SortFields.Add Key:=Range("A4:A39"), SortOn:=xlSortOnValues, _
Order:=xlAscending, DataOption:=xlSortNormal
.SetRange Range("A3:P39")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End With
End Sub
Bookmarks