PC Review


Reply
 
 
=?Utf-8?B?VGhlIEJyaUd1eQ==?=
Guest
Posts: n/a
 
      29th Mar 2007
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??
 
Reply With Quote
 
 
 
 
=?Utf-8?B?QnJvdGhhIExlZQ==?=
Guest
Posts: n/a
 
      29th Mar 2007
Try the following
Range("L4").value = dateserial(year(L5),month(L5)+1,day(L5))

HTH
"The BriGuy" wrote:

> 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??

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      29th Mar 2007
Sub addmonthtodate()' NO selections
mc = Range("l5")
Range("l4") = DateSerial(Year(mc), Month(mc) + 1, Day(mc))
End Sub

--
Don Guillett
SalesAid Software
(E-Mail Removed)
"The BriGuy" <(E-Mail Removed)> wrote in message
news:9B0F3410-C761-4E93-8B02-(E-Mail Removed)...
> 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??



 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      29th Mar 2007

tested?

--
Don Guillett
SalesAid Software
(E-Mail Removed)
"Brotha Lee" <(E-Mail Removed)> wrote in message
newsFCDE132-8D67-4876-9FD8-(E-Mail Removed)...
> Try the following
> Range("L4").value = dateserial(year(L5),month(L5)+1,day(L5))
>
> HTH
> "The BriGuy" wrote:
>
>> 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??



 
Reply With Quote
 
=?Utf-8?B?VGhlIEJyaUd1eQ==?=
Guest
Posts: n/a
 
      29th Mar 2007
I tried this and got back 1/31/00

"Brotha Lee" wrote:

> Try the following
> Range("L4").value = dateserial(year(L5),month(L5)+1,day(L5))
>
> HTH
> "The BriGuy" wrote:
>
> > 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??

 
Reply With Quote
 
=?Utf-8?B?VGhlIEJyaUd1eQ==?=
Guest
Posts: n/a
 
      29th Mar 2007
I tried this and got back 1/31/00

"Brotha Lee" wrote:

> Try the following
> Range("L4").value = dateserial(year(L5),month(L5)+1,day(L5))
>
> HTH
> "The BriGuy" wrote:
>
> > 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??

 
Reply With Quote
 
=?Utf-8?B?VGhlIEJyaUd1eQ==?=
Guest
Posts: n/a
 
      29th Mar 2007
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
> (E-Mail Removed)
> "The BriGuy" <(E-Mail Removed)> wrote in message
> news:9B0F3410-C761-4E93-8B02-(E-Mail Removed)...
> > 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??

>
>
>

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      29th Mar 2007
"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
(E-Mail Removed)
"The BriGuy" <(E-Mail Removed)> wrote in message
news:F6B3471D-8469-410F-84E6-(E-Mail Removed)...
> 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
>> (E-Mail Removed)
>> "The BriGuy" <(E-Mail Removed)> wrote in message
>> news:9B0F3410-C761-4E93-8B02-(E-Mail Removed)...
>> > 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??

>>
>>
>>



 
Reply With Quote
 
=?Utf-8?B?VGhlIEJyaUd1eQ==?=
Guest
Posts: n/a
 
      29th Mar 2007
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
> (E-Mail Removed)
> "The BriGuy" <(E-Mail Removed)> wrote in message
> news:F6B3471D-8469-410F-84E6-(E-Mail Removed)...
> > 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
> >> (E-Mail Removed)
> >> "The BriGuy" <(E-Mail Removed)> wrote in message
> >> news:9B0F3410-C761-4E93-8B02-(E-Mail Removed)...
> >> > 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??
> >>
> >>
> >>

>
>
>

 
Reply With Quote
 
Don Guillett
Guest
Posts: n/a
 
      29th Mar 2007
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
(E-Mail Removed)
"The BriGuy" <(E-Mail Removed)> wrote in message
news:43D7BB0F-2647-4BDC-97B8-(E-Mail Removed)...
> 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
>> (E-Mail Removed)
>> "The BriGuy" <(E-Mail Removed)> wrote in message
>> news:F6B3471D-8469-410F-84E6-(E-Mail Removed)...
>> > 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
>> >> (E-Mail Removed)
>> >> "The BriGuy" <(E-Mail Removed)> wrote in message
>> >> news:9B0F3410-C761-4E93-8B02-(E-Mail Removed)...
>> >> > 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??
>> >>
>> >>
>> >>

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DateAdd =?Utf-8?B?QW1pbg==?= Microsoft Access Reports 3 1st Mar 2007 11:58 PM
DateAdd??? =?Utf-8?B?Tml4eGll?= Microsoft Access Database Table Design 3 8th Nov 2006 09:04 PM
DateAdd =?Utf-8?B?Ym9iYzcyMQ==?= Microsoft Access Queries 2 12th Oct 2006 12:52 PM
RE: Help with DateAdd =?Utf-8?B?T2Zlcg==?= Microsoft Access Queries 0 2nd Feb 2006 03:29 PM
dateadd dan Microsoft Access Queries 5 31st Dec 2003 04:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:49 AM.