Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default automatically date a cell when entering data in adjoining cell

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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default automatically date a cell when entering data in adjoining cell

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
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
Can I get a cell to automatically rezero after entering a value. H Kanta1435 Excel Discussion (Misc queries) 1 December 7th 09 06:42 AM
Automatically open list box on entering the cell toolman74 Excel Discussion (Misc queries) 1 September 13th 08 08:33 PM
exit cell automatically after entering data Patrick Riley Excel Worksheet Functions 0 March 20th 08 03:23 PM
Move to next unprotected cell automatically after entering data Patrick Riley Excel Discussion (Misc queries) 2 April 2nd 07 10:17 PM
How does a cell automatically highlight itself after entering numb Janet Excel Discussion (Misc queries) 2 February 16th 06 04:02 AM


All times are GMT +1. The time now is 01:56 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"