ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Date Function problem (https://www.excelbanter.com/excel-programming/338872-date-function-problem.html)

VW_Dick

Date Function problem
 

Ive set up a macro assigned to a button that inserts the date into th
selected cell via the date function and then moves cursor one column t
the right. When the date is inserted the cursor moves to cell to th
right just fine.
The problem is that when I use the macro to insert the date and tim
into another cell at a later time or date, all of the other date
change to the most recent one.

Am i cra-z or should this not happen?

Thank

--
VW_Dic
-----------------------------------------------------------------------
VW_Dick's Profile: http://www.excelforum.com/member.php...fo&userid=2684
View this thread: http://www.excelforum.com/showthread.php?threadid=40089


Chip Pearson

Date Function problem
 
If you are inserting a formula, it will always update when a
calculation is performed. To insert a static date, one that will
not change, use code like


ActiveCell.Value = Now


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"VW_Dick"
wrote in message
...

Ive set up a macro assigned to a button that inserts the date
into the
selected cell via the date function and then moves cursor one
column to
the right. When the date is inserted the cursor moves to cell
to the
right just fine.
The problem is that when I use the macro to insert the date and
time
into another cell at a later time or date, all of the other
dates
change to the most recent one.

Am i cra-z or should this not happen?

Thanks


--
VW_Dick
------------------------------------------------------------------------
VW_Dick's Profile:
http://www.excelforum.com/member.php...o&userid=26847
View this thread:
http://www.excelforum.com/showthread...hreadid=400898




bigwheel

Date Function problem
 
What code does your macro use to insert the date? I tried Activecell = Date
and it worked in the way you want i.e. the result is different if the date
changes

"VW_Dick" wrote:


Ive set up a macro assigned to a button that inserts the date into the
selected cell via the date function and then moves cursor one column to
the right. When the date is inserted the cursor moves to cell to the
right just fine.
The problem is that when I use the macro to insert the date and time
into another cell at a later time or date, all of the other dates
change to the most recent one.

Am i cra-z or should this not happen?

Thanks


--
VW_Dick
------------------------------------------------------------------------
VW_Dick's Profile: http://www.excelforum.com/member.php...o&userid=26847
View this thread: http://www.excelforum.com/showthread...hreadid=400898



RonaldF

Date Function problem
 
If you use this: ActiveCell.Value = Now

It would not change the date/time, when you use it later on in a other cell.

--
Ronald Ferdinandus
http://www.ro-pay.nl


"VW_Dick" wrote:


Ive set up a macro assigned to a button that inserts the date into the
selected cell via the date function and then moves cursor one column to
the right. When the date is inserted the cursor moves to cell to the
right just fine.
The problem is that when I use the macro to insert the date and time
into another cell at a later time or date, all of the other dates
change to the most recent one.

Am i cra-z or should this not happen?

Thanks


--
VW_Dick
------------------------------------------------------------------------
VW_Dick's Profile: http://www.excelforum.com/member.php...o&userid=26847
View this thread: http://www.excelforum.com/showthread...hreadid=400898



RonaldF

Date Function problem
 
If you use this: ActiveCell.Value = Now

It would not change the date/time, when you use it later on in a other cell.

--
Ronald Ferdinandus
http://www.ro-pay.nl


"VW_Dick" wrote:


Ive set up a macro assigned to a button that inserts the date into the
selected cell via the date function and then moves cursor one column to
the right. When the date is inserted the cursor moves to cell to the
right just fine.
The problem is that when I use the macro to insert the date and time
into another cell at a later time or date, all of the other dates
change to the most recent one.

Am i cra-z or should this not happen?

Thanks


--
VW_Dick
------------------------------------------------------------------------
VW_Dick's Profile: http://www.excelforum.com/member.php...o&userid=26847
View this thread: http://www.excelforum.com/showthread...hreadid=400898



Tom Ogilvy

Date Function problem
 
sounds like you are putting in the formula

=Now()

instead use the vba function now

ActiveCell.Value = Now
ActiveCell.offset(0,1).Select

--
Regards,
Tom Ogilvy

"VW_Dick" wrote in
message ...

Ive set up a macro assigned to a button that inserts the date into the
selected cell via the date function and then moves cursor one column to
the right. When the date is inserted the cursor moves to cell to the
right just fine.
The problem is that when I use the macro to insert the date and time
into another cell at a later time or date, all of the other dates
change to the most recent one.

Am i cra-z or should this not happen?

Thanks


--
VW_Dick
------------------------------------------------------------------------
VW_Dick's Profile:

http://www.excelforum.com/member.php...o&userid=26847
View this thread: http://www.excelforum.com/showthread...hreadid=400898




VW_Dick[_2_]

Date Function problem
 

Wow, thanks for all the replys.

I used the code :

ActiveCell.Value = Now

ActiveCell.Offset(0, 1).Select

and it works exactly how i need it to.

Thanks to everyone for all the help

Richard


--
VW_Dick
------------------------------------------------------------------------
VW_Dick's Profile: http://www.excelforum.com/member.php...o&userid=26847
View this thread: http://www.excelforum.com/showthread...hreadid=400898



All times are GMT +1. The time now is 05:36 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com