Thread: dateadd
View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
The BriGuy[_2_] The BriGuy[_2_] is offline
external usenet poster
 
Posts: 16
Default dateadd

Perfect. I ran it thru 2008 and the info was good.

Thanks for the help


"Don Guillett" wrote:

Always nice to say what you want the FIRST time.

Sub addmonthtodate() ' NO selections
mc = Range("a1")
Range("i1") = DateSerial(Year(mc), Month(mc) + 2, 1 - 1)
End Sub

--
Don Guillett
SalesAid Software

"The BriGuy" wrote in message
...
Sorry about the lack of clarity. I tried this and it almost did what I
wanted. The date moved from 6/30/06 to 7/30/06 and I tried from 8/31/06
and
it went to 10/01/06. I am looking for it to go to the last day of the
month
(ie. 6/30/06 to 7/31/06 and 8/31/06 to 9/30/06).

I appreciate the help on this. Any idea what I can change to get it to
work
the way I had hoped?

Thanks

"Don Guillett" wrote:

"Didn't work" means nothing without explanation.
I fully tested. Shouldn't make any difference but you didn't post your
code,
so???

mc = Range("l5")
Range("l4") = DateSerial(Year(mc), Month(mc) + 1, Day(mc))

--
Don Guillett
SalesAid Software

"The BriGuy" wrote in message
...
This didn't work either. I think because this is being put in the
middle
of
a larger macro that was expected to end befor I entered Sub again?

"Don Guillett" wrote:

Sub addmonthtodate()' NO selections
mc = Range("l5")
Range("l4") = DateSerial(Year(mc), Month(mc) + 1, Day(mc))
End Sub

--
Don Guillett
SalesAid Software

"The BriGuy" wrote in message
...
In a macro I would like to add 1 month to a date in another cell.
L5 =
3/31/07 so when the macro runs I would like L4 to display 4/30/07.
something
like:

Range("L4").Select
ActiveCell. add 1 month to date in L5.

Any ideas??