Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 116
Default Record date cell is inputted

Is there a way to format now(), or today( ) to enter when a cell is inputed.
I'm trying to record the date when I pay a bill, but everytime I open up the
worksheet the date recalculates. Here's what I have so far.
C1="Paid Amount"
D1=if(C1="","",C1=NOW())
like I said though everytime I open the worksheet, say I inputed the bill on
6/7/2006, It converts it to today like I just did it..... Very frustrated...

Thanks for your time
Marty
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 22,906
Default Record date cell is inputted

Marty

You can enter a static date in a cell by hitting CTRL + ;(semi-colon)

You could also use event code to enter a static date when you enter something in
a cell.

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
'when entering data in a cell in Col C
On Error GoTo enditall
Application.EnableEvents = False
If Target.Cells.Column = 3 Then
n = Target.Row
If Excel.Range("C" & n).Value < "" Then
Excel.Range("D" & n).Value = Format(Now, "dd mm yyyy")
End If
End If
enditall:
Application.EnableEvents = True
End Sub

This is sheet event code. Right-click on the sheet tab and "View Code"

Copy/paste the above into that module.

Enter a value in C1 and D1 will return a static date.


Gord Dibben MS Excel MVP

On Tue, 23 Jan 2007 12:21:02 -0800, Marty
wrote:

Is there a way to format now(), or today( ) to enter when a cell is inputed.
I'm trying to record the date when I pay a bill, but everytime I open up the
worksheet the date recalculates. Here's what I have so far.
C1="Paid Amount"
D1=if(C1="","",C1=NOW())
like I said though everytime I open the worksheet, say I inputed the bill on
6/7/2006, It converts it to today like I just did it..... Very frustrated...

Thanks for your time
Marty


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
Need the formula or macro. If i enter today date in the cell (Row 1,Column 2) and on tab out, the column 1 cell should be filled with "corresponding Day" of the date kakasay Excel Discussion (Misc queries) 1 January 22nd 07 12:31 PM
Recording the date another cell is edited or modified. Ed Excel Worksheet Functions 2 December 2nd 06 03:22 AM
Empty Date Cell as Zero [email protected] Excel Discussion (Misc queries) 1 September 22nd 06 01:09 AM
Help with this conditional IF statement C-Dawg Excel Discussion (Misc queries) 3 May 15th 06 06:01 PM
Addition to Turn cell red if today is greater or equal to date in cell Rich New Users to Excel 2 December 9th 04 02:06 AM


All times are GMT +1. The time now is 11:09 AM.

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"