check for last day of month
Try this:
Sub EndMonth()
If Range("D1") = Evaluate("=EOMONTH(Now(),0)") Then
Range("A1").Delete
End If
End Sub
You need to replace the D1 with the location of your date. Set this to run
with the workbook opens.
One note: The EOMonth function requires the Analysis ToolPack. If you get
an error, check under Tools = Add-Ins to make sure it is installed.
"pswanie" wrote:
i need a mocro to check if its the last day of the month and if so del
contents in cell a1
for example
chek if day = 31 then del range a1. if only 30 days in month then
chek if day = 30 then del range a1. if only 28 days in month then
chek if day = 28 then del range a1. if non of above then nothing
it can use the system date to chek what month is the current month
|