![]() |
|
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 6
|
I see that there are two functions for this type of activity. I attempted to use the Now() function, but found that data entered yesterday now has today's date, instead of yesterday's date. I am going to test the Today() function and see if it works differently, but have a feeling that it will work the same. Does anybody have any insight on this?
[ This Message was edited by: goodwisa on 2002-05-08 08:48 ] [ This Message was edited by: goodwisa on 2002-05-08 08:48 ] |
|
|
|
|
|
#2 |
|
Board Regular
Join Date: Apr 2002
Location: Midlands, UK
Posts: 217
|
If you've left the cell as the formula it will keep updating through out the day - enter =NOW() in a cell, leave it for a minute & press F9 to re-calculate. The value for the cell will have changed because the cell is returning the current value. TODAY() will work the same( except it returns the date value, NOW() returns Date & Time ).
When you enter the formula in the cell press F9 before you hit Enter - this changes a formula to a value. Or you could use the Copy...Paste Special function to "fix" the date. |
|
|
|
|
|
#3 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Austin, Texas USA
Posts: 11,654
|
Or... simply press Control+;
|
|
|
|
|
|
#4 |
|
New Member
Join Date: Mar 2002
Posts: 6
|
I wanted column C to autopopulate with the date based on an entry in Column B. By putting the code in Visual Basic, it populates the cell with the value instead of the formula, so it won't change from day to day. Here is the code.
Private Sub Worksheet_Change (ByVal Target As Range) If Target.Column <> 2 Then Exit Sub ElseIf Target.Value <> "" Then Range("C" & Target.Row) = Now() ElseIf Target.Value = "" Then Range("C" & Target.Row) = "" End If End Sub [ This Message was edited by: goodwisa on 2002-05-09 06:03 ] |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|