so i put the following code in my "Closed POs" sheet.
[CODE]
Private Sub Worksheet_Change(ByVal Target As Range)
Dim KeyCells As Range
Dim FullExcelPath As String
FullExcelPath = ThisWorkbook.FullName
'MsgBox FullExcelPath
Application.DisplayAlerts = False
' 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, Range(Target.Address)) _
Is Nothing Then
Select Case Target.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
End If
End Sub
/CODE]
so the stub works as expected, when i change dates it goes through the case statement properly. but what i really want is for this to be a OPEN worksheet event as well. it should check the Aging date in column D and see if its a month old or older.
i figure this should be a worksheet event but im not sure of how to transfer the code in the stub to the ThisWorkbook code sheet.
thoughts?
Bookmarks