PC Review


Reply
Thread Tools Rate Thread

Autofill today's date Everyday

 
 
=?Utf-8?B?QU0=?=
Guest
Posts: n/a
 
      22nd Aug 2007
I am not sure if this is even possible, I would like to see today's date in
column A everyday in new cell, maintaining previous cell with yesteray's date
and previous before previous cell with day before yesterday's date and so on.
So every weekday you see today's date in the cell.
e.g

08/20/2007
08/21/2007
08/22/2007 Today
Will show up tomorrow as 8/23/2007
Will show up Friday as 8/24/2007

Will be one blank row for saturday & Sunday
Will show up Monday as 8/27/2007

Thanks
AM



 
Reply With Quote
 
 
 
 
=?Utf-8?B?UHJhbmF2IFZhaWR5YQ==?=
Guest
Posts: n/a
 
      22nd Aug 2007
Hi AM,

Please paste the below macro in your workbook.

Dim mLastRow As Integer

Dim mdate As Date
mdate = Date
If Weekday(mdate) > 1 Then
mLastRow = Range("A65000").End(xlUp).Row + 2
Else
mLastRow = Range("A65000").End(xlUp).Row + 1
Range("A" & mLastRow).Value = mdate
End If

This will automatically check for saturday and sunday and will skip a row
while inseting new date. I have tested this.
Hope this helps!!
--
Pranav Vaidya
VBA Developer
PN, MH-India
If you think my answer is useful, please rate this post as an ANSWER!!


"AM" wrote:

> I am not sure if this is even possible, I would like to see today's date in
> column A everyday in new cell, maintaining previous cell with yesteray's date
> and previous before previous cell with day before yesterday's date and so on.
> So every weekday you see today's date in the cell.
> e.g
>
> 08/20/2007
> 08/21/2007
> 08/22/2007 Today
> Will show up tomorrow as 8/23/2007
> Will show up Friday as 8/24/2007
>
> Will be one blank row for saturday & Sunday
> Will show up Monday as 8/27/2007
>
> Thanks
> AM
>
>
>

 
Reply With Quote
 
=?Utf-8?B?QU0=?=
Guest
Posts: n/a
 
      22nd Aug 2007
Pranav,

I must be doing something wrong, I am not excel expert, I created new macro
and then I ran the macro but nothing happens. The cell is still blank. You
think I am missing something?

Thanks
AM

"Pranav Vaidya" wrote:

> Hi AM,
>
> Please paste the below macro in your workbook.
>
> Dim mLastRow As Integer
>
> Dim mdate As Date
> mdate = Date
> If Weekday(mdate) > 1 Then
> mLastRow = Range("A65000").End(xlUp).Row + 2
> Else
> mLastRow = Range("A65000").End(xlUp).Row + 1
> Range("A" & mLastRow).Value = mdate
> End If
>
> This will automatically check for saturday and sunday and will skip a row
> while inseting new date. I have tested this.
> Hope this helps!!
> --
> Pranav Vaidya
> VBA Developer
> PN, MH-India
> If you think my answer is useful, please rate this post as an ANSWER!!
>
>
> "AM" wrote:
>
> > I am not sure if this is even possible, I would like to see today's date in
> > column A everyday in new cell, maintaining previous cell with yesteray's date
> > and previous before previous cell with day before yesterday's date and so on.
> > So every weekday you see today's date in the cell.
> > e.g
> >
> > 08/20/2007
> > 08/21/2007
> > 08/22/2007 Today
> > Will show up tomorrow as 8/23/2007
> > Will show up Friday as 8/24/2007
> >
> > Will be one blank row for saturday & Sunday
> > Will show up Monday as 8/27/2007
> >
> > Thanks
> > AM
> >
> >
> >

 
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
How to autofill cell with today's date on edit mjg916 Microsoft Excel Misc 1 10th Dec 2009 03:33 AM
Repost - Autofill today's date Everyday =?Utf-8?B?QU0=?= Microsoft Excel Programming 8 23rd Aug 2007 08:28 PM
how come =date(year(today()),month(today())+6,today()) show 2097? dindigul Microsoft Excel Discussion 4 14th May 2007 08:47 PM
A .Net Trick Everyday! (subject of today: SHA1 - Secure Hash Algorithm Class) Nuri YILMAZ Microsoft Dot NET Framework 0 13th Aug 2004 12:41 PM
open a form at today's date or next date if no match for today Rod Isaacs, St George Hospital Microsoft Access Form Coding 1 7th Jan 2004 08:36 AM


Features
 

Advertising
 

Newsgroups
 


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