Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 222
Default 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


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default 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




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Function to lookup date on tab in excel and populate date on calen MGC Excel Worksheet Functions 0 February 4th 10 04:48 AM
Exel increment date problem wrt todays date. [email protected] Excel Worksheet Functions 1 November 11th 07 06:58 PM
Date Formula Problem - Leave date blank if Null Gayla Excel Worksheet Functions 5 April 24th 07 09:42 PM
If Function - Date Problem JEM Excel Worksheet Functions 2 June 12th 06 01:49 PM
Calculating days between current date and a date in future NETWORKDAYS() function Faheem Khan Excel Worksheet Functions 2 February 10th 05 07:18 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"