Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macro to record date on sheet data is entered in a cell ?

I need a macro to auto insert in an adjacent call the date data is entered in
a cell.
The following does not work because "Now" changes every day:
=IF(CK3<"",NOW(),"")
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default Macro to record date on sheet data is entered in a cell ?

This tiny macro looks for changes in column A and puts the date in the
corresponding row in column B:


Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("A:A")) Is Nothing Then Exit Sub
Target.Offset(0, 1) = Now
End Sub

This should be copied to worksheet code, not a standard module.
--
Gary's Student


"Jim scrivener" wrote:

I need a macro to auto insert in an adjacent call the date data is entered in
a cell.
The following does not work because "Now" changes every day:
=IF(CK3<"",NOW(),"")

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Macro to record date on sheet data is entered in a cell ?

Here is some code that should do what you want... Paste this into the sheet
(right click the sheet tab and select view code). This code works on Cell CK3
but you can change it to whatever range you want...

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Range("CK3")) Is Nothing Then _
Target.Offset(0, 1).Value = Now()
End Sub

--
HTH...

Jim Thomlinson


"Jim scrivener" wrote:

I need a macro to auto insert in an adjacent call the date data is entered in
a cell.
The following does not work because "Now" changes every day:
=IF(CK3<"",NOW(),"")

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
Data entered in one record is shifting to others shekpatrick New Users to Excel 1 December 30th 08 07:51 PM
how do I record the time data is entered into a spreadsheet? bmk Excel Worksheet Functions 2 November 15th 07 04:53 AM
date and time entered when a cell contains data john tempest[_2_] Excel Programming 3 November 30th 05 04:50 PM
recording the date when record was entered in cell in Excel mcgoo Excel Worksheet Functions 1 February 10th 05 10:11 PM
Input Date when data is entered into another cell GaryByrd Excel Worksheet Functions 2 February 1st 05 12:37 AM


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

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

About Us

"It's about Microsoft Excel"