PC Review


Reply
Thread Tools Rate Thread

automatically date a cell when entering data in adjoining cell

 
 
=?Utf-8?B?Sm9obiBJbW0=?=
Guest
Posts: n/a
 
      9th Oct 2006
I would like Excel to automatically date, with today's date, when the
adjoining cell recieves data: ie date C3 when D3 recieves data. Is this
possivble?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      9th Oct 2006
Here is an old post of mine that lays it out:

If you are asking how you would do it in code.

Right click on the sheet tab for that sheet. Select view code. In the left
dropdown, select worksheet, in the right, Change.


This sub will appear:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)


End Sub


You can put in code like this


Assume you will enter the name in Cell B5 and you want the date put in cell
C5


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$C$3" Then
If Len(Trim(Target.Value)) > 0 Then
Target.Offset(0, 1).NumberFormat = "mm/dd/yyyy"
Target.Offset(0, 1).Value = Date
Target.Offset(0, 1).EntireColumn.AutoFit
End If
End If
End Sub


If you want this to happen if anything is entered in column C


Private Sub Worksheet_Change(ByVal Target As Excel.Range)
if target.column = 3 then
If Len(Trim(Target.Value)) > 0 Then
Target.Offset(0, 1).NumberFormat = "mm/dd/yyyy"
Target.Offset(0, 1).Value = Date
Target.Offset(0, 1).EntireColumn.AutoFit
End If
End if
End Sub


Regards,
Tom Ogilvy


"John Imm" wrote:

> I would like Excel to automatically date, with today's date, when the
> adjoining cell recieves data: ie date C3 when D3 recieves data. Is this
> possivble?

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
exit cell automatically after entering data Patrick Riley Microsoft Excel Programming 1 20th Mar 2008 04:15 PM
Automatically entering date or time in a cell upon entering Jim w Microsoft Excel Misc 2 22nd Jan 2004 02:10 PM
automatically entering data into a cell shanman_lmtd Microsoft Excel Misc 3 6th Jan 2004 09:43 AM
Re: automatically entering data into a cell Arvi Laanemets Microsoft Excel Misc 1 5th Jan 2004 05:17 PM
Automatically entering the date saved in a cell Bret B Microsoft Excel Worksheet Functions 5 6th Sep 2003 06:15 PM


Features
 

Advertising
 

Newsgroups
 


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