Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / July 2008

Tip: Looking for answers? Try searching our database.

macro to make current date remain fixed

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
line - 31 Jul 2008 16:41 GMT
Hi,
I want to insert a current date into a cell, but then to have that date
remain fixed.  Basically, Im using an IF function to create a date in a cell
along the lines of IF(A2>801000000000,NOW()).  The current date fills the
cell, but then changes the next day because of the internal clock.

Ideas?
sbitaxi@gmail.com - 31 Jul 2008 16:58 GMT
> Hi,
> I want to insert a current date into a cell, but then to have that date
[quoted text clipped - 3 lines]
>
> Ideas?

Copy>Paste Special>Values
That will keep it fixed to that date, but it eliminates the formula
for the range you have replaced.
line - 31 Jul 2008 17:34 GMT
Thank you sbi, I know about the copy paste special and that's why I'd like to
know if anyone has a macro idea to get around the copy paste special.

> > Hi,
> > I want to insert a current date into a cell, but then to have that date
[quoted text clipped - 7 lines]
> That will keep it fixed to that date, but it eliminates the formula
> for the range you have replaced.
sbitaxi@gmail.com - 31 Jul 2008 17:57 GMT
> Thank you sbi, I know about the copy paste special and that's why I'd like to
> know if anyone has a macro idea to get around the copy paste special.
[quoted text clipped - 11 lines]
> > That will keep it fixed to that date, but it eliminates the formula
> > for the range you have replaced.

Do you want the Date to appear in the same column, or can it appear in
another column? If another, then you can capture on the Date column,
if blank, AND if A2>801000000000 Then Now
Sub Dater()

Dim MyCell As Range

For Each MyCell In Range("A:A")
     If MyCell.Value > "5" Then
                 If MyCell.Offset(0, 1).Value = "" Then
                       MyCell.Offset(0, 1).Value = Now()
                 End If
       End If
Next

End Sub

That will give you the current date/Time in the next column.
sbitaxi@gmail.com - 31 Jul 2008 18:01 GMT
On Jul 31, 12:57 pm, sbit...@gmail.com wrote:

> > Thank you sbi, I know about the copy paste special and that's why I'd like to
> > know if anyone has a macro idea to get around the copy paste special.
[quoted text clipped - 30 lines]
>
> That will give you the current date/Time in the next column.

Just change the line
If MyCell.Value > "5" Then

to
If MyCell.Value > "801000000000" Then
sammy - 31 Jul 2008 19:12 GMT
Hi,

Got this from the help file:

To insert the current date, press CTRL+; (semi-colon).
To insert the current time, press CTRL+SHIFT+; (semi-colon).
to insert the current date and time, press CTRL+; (semi-colon), then press
SPACE, and then press CTRL+SHIFT+; (semi-colon).

Sammy

> Hi,
> I want to insert a current date into a cell, but then to have that date
[quoted text clipped - 3 lines]
>
> Ideas?
sammy - 31 Jul 2008 19:36 GMT
nevermind...i forgot which group i was in.

> Hi,
>
[quoted text clipped - 14 lines]
> >
> > Ideas?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.