D
dolphinv4
Hi,
I'd like to create a button such that on clicking it,
cell A1 will show the last day of last month, for
example, today is 20/5/04 so on clicking the button,
it'll show 30/4/04 in cell A1.
I tried using the following macro which I had used
previously for other purposes but it doesn't seem to work
in this case:
With Range("A1")
.Value = DateSerial(Year(.Value), Month(.Value) +
2, 0)
End With
What code shld I use?
Thanks!
val
I'd like to create a button such that on clicking it,
cell A1 will show the last day of last month, for
example, today is 20/5/04 so on clicking the button,
it'll show 30/4/04 in cell A1.
I tried using the following macro which I had used
previously for other purposes but it doesn't seem to work
in this case:
With Range("A1")
.Value = DateSerial(Year(.Value), Month(.Value) +
2, 0)
End With
What code shld I use?
Thanks!
val