I have a macro that has a date compare function, my problem is that i want it to ignore the year of the date so that the sheet can be re-used each year without changing the DateValue to the following year.
here is my code:
Sub lock_aug()
If Date < DateValue("8/31/2013") Then
Run "Lock_Date_Error.Lock_Date_Error"
Exit Sub
End If
ActiveSheet.Unprotect
If Date > DateValue("8/31/2013") Then
Range("ds5:ei70").Value = Range("ds5:ei70").Value
End If
If Date > DateValue("8/31/2013") Then
Range("ds5:ei70").Locked = True
End If
ActiveSheet.Protect Contents:=True
End Sub
i would like to do something like:
If date > datevalue (8/31/Year())
Is this even possible?
here is my code:
Sub lock_aug()
If Date < DateValue("8/31/2013") Then
Run "Lock_Date_Error.Lock_Date_Error"
Exit Sub
End If
ActiveSheet.Unprotect
If Date > DateValue("8/31/2013") Then
Range("ds5:ei70").Value = Range("ds5:ei70").Value
End If
If Date > DateValue("8/31/2013") Then
Range("ds5:ei70").Locked = True
End If
ActiveSheet.Protect Contents:=True
End Sub
i would like to do something like:
If date > datevalue (8/31/Year())
Is this even possible?