I am having some difficulty with a macro that runs when a specific file is opened. What I need is for the macro to check the difference between the date the file was last updated (stored in cell A52) and the current date (which I have currently stored in A54 as the formula TODAY()).
Both cells are set to the same type and I have added a third option (cell A57) which does the calculation A54-A52 (set to type General). The macro is below, but I can't seem to get it to work properly. Does anyone know what I am doing wrong? The second option (displaying the message) seems to work and if I replace it with the Workbook.Close command it will run then but it doesn't run the first check at all (chances are I am referencing the IF Check incorectly but for the life of me I can't find the correct reference).
I appreciate any help that people can provide.
Sub Autpen()
If (R57C1) > 30 Then
ActiveWorkbook.Close savechanges:=False
Else
Range("B3").Select
MsgBox ("<MESSAGE>")
End If
End Sub
Both cells are set to the same type and I have added a third option (cell A57) which does the calculation A54-A52 (set to type General). The macro is below, but I can't seem to get it to work properly. Does anyone know what I am doing wrong? The second option (displaying the message) seems to work and if I replace it with the Workbook.Close command it will run then but it doesn't run the first check at all (chances are I am referencing the IF Check incorectly but for the life of me I can't find the correct reference).
I appreciate any help that people can provide.
Sub Autpen()
If (R57C1) > 30 Then
ActiveWorkbook.Close savechanges:=False
Else
Range("B3").Select
MsgBox ("<MESSAGE>")
End If
End Sub