Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Alec H
 
Posts: n/a
Default Auto date entry for status change


Hi,

Latest brainteaser,

I have a Excel 2000 pro workbook, in one of the spreadsheets I have
column (E) that uses a dropdown list (Data/Validation/List). I want the
next column (F) to automatically show the date that the entry to column
E was last changed or if there has been no change show a generic start
date....

Is this possible?


--
Alec H
------------------------------------------------------------------------
Alec H's Profile: http://www.excelforum.com/member.php...o&userid=31042
View this thread: http://www.excelforum.com/showthread...hreadid=508924

  #2   Report Post  
Posted to microsoft.public.excel.misc
Tom Ogilvy
 
Posts: n/a
Default Auto date entry for status change

right click on the sheet tab and select view code. In the resulting module
paste in code like this:

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Column = 5 Then
Cells(Target.Row, 6).Value = Now
Cells(Target.Row, 6).NumberFormat = "mm/dd/yyyy hh:mm"
Target.Offset(0, 1).EntireColumn.AutoFit
End If
End Sub

You can run a onetime macro to fill any empty cells

Sub FillWithGeneric()
Set rng = Columns(5).SpecialCells(xlConstants)
For Each cell In rng
With cell.Offset(0, 1)
If IsEmpty(.Value) Then
.Value = DateValue("01/01/2006") + TimeValue("08:00")
.NumberFormat = "mm/dd/yyyy hh:mm"
End If
End With
Next
Columns(5).AutoFit
End Sub

--
Regards,
Tom Ogilvy


"Alec H" wrote in
message ...

Hi,

Latest brainteaser,

I have a Excel 2000 pro workbook, in one of the spreadsheets I have
column (E) that uses a dropdown list (Data/Validation/List). I want the
next column (F) to automatically show the date that the entry to column
E was last changed or if there has been no change show a generic start
date....

Is this possible?


--
Alec H
------------------------------------------------------------------------
Alec H's Profile:

http://www.excelforum.com/member.php...o&userid=31042
View this thread: http://www.excelforum.com/showthread...hreadid=508924



  #3   Report Post  
Posted to microsoft.public.excel.misc
Alec H
 
Posts: n/a
Default Auto date entry for status change


Tom,

Thank you, that "little" piece of code has solved the problem :)

Watch this space for my next bumbling query.......;)


--
Alec H
------------------------------------------------------------------------
Alec H's Profile: http://www.excelforum.com/member.php...o&userid=31042
View this thread: http://www.excelforum.com/showthread...hreadid=508924

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
Formula to change number into date anjgoss Excel Discussion (Misc queries) 4 September 28th 05 10:47 AM
How change Excel default date format to something useful mjk Excel Discussion (Misc queries) 1 September 26th 05 08:15 PM
Help: Can I change the date formula from mm/dd/yyyy to "mmm-yy" et wintersunshine Excel Discussion (Misc queries) 7 July 5th 05 09:44 PM
cell color change based on due date MINAL ZUNKE New Users to Excel 2 June 30th 05 09:24 PM
How would I change a date cell to decrease it by business days? CNGracin Excel Discussion (Misc queries) 3 December 15th 04 05:20 PM


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