Hi again.
I would recommend that you use a separate routine to process the cells like this
Sub processDates(ByVal Target As Range)
Dim cell As Range
for each cell in Target.Cells
Select Case cell.Value
Case Is < Now - 30
MsgBox "Move to Closed PO archive file"
Case Is >= Now - 30
MsgBox "Keep for now"
Case Else
MsgBox "Case Else"
End Select
next cell
End Sub
then call that as required
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
' The variable KeyCells contains the cells that will
' cause an alert when they are changed.
Set KeyCells = Range("d:d")
If Not Application.Intersect(KeyCells, Target) Is Nothing Then
processCells Application.Intersect(KeyCells, Target)
End If
End Sub
and
Private Sub Workbook_Open()
with Sheets("")
processCells Application.Intersect(.Range("d:d"), .UsedRange)
end with
end sub
Bookmarks