#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 577
Default Event Macro help

I would like to record and display the date in a column when a particular
event happens.

For example, I'd like to display the date that each row in Column A displays
"Complete."

If the task in A1 is completed today, I'd like B1 to display "3/22/2010" and
for it to stay that way unless changed or deleted.

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 457
Default Event Macro help

'Note that for this to work, column A must be manually changed,
'not a formula creating an output.

Private Sub Worksheet_Change(ByVal Target As Range)
'Is it a cell we care about?
If Intersect(Target, Range("A:A")) Is Nothing Then Exit Sub
'Is it a single cell?
If Target.Count 1 Then Exit Sub
'Is criteria met?
If UCase(Target.Value) = "COMPLETE" Then
Target.Offset(0, 1).Value = Date
End If
End Sub

--
Best Regards,

Luke M
"Scott" wrote in message
...
I would like to record and display the date in a column when a particular
event happens.

For example, I'd like to display the date that each row in Column A
displays
"Complete."

If the task in A1 is completed today, I'd like B1 to display "3/22/2010"
and
for it to stay that way unless changed or deleted.

Thanks!



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 11,501
Default Event Macro help

Scott,

Try this

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("A:A")) Is Nothing Then
Application.EnableEvents = False
If UCase(Target.Value) = "COMPLETE" Then
Target.Offset(, 1).Value = Date
End If
End If
Application.EnableEvents = True
End Sub
--
Mike

When competing hypotheses are otherwise equal, adopt the hypothesis that
introduces the fewest assumptions while still sufficiently answering the
question.


"Scott" wrote:

I would like to record and display the date in a column when a particular
event happens.

For example, I'd like to display the date that each row in Column A displays
"Complete."

If the task in A1 is completed today, I'd like B1 to display "3/22/2010" and
for it to stay that way unless changed or deleted.

Thanks!

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 577
Default Event Macro help

What happens when the original entry is changed and no longer matches the
"Complete" status? I would want for B1 to clear.

"Scott" wrote:

I would like to record and display the date in a column when a particular
event happens.

For example, I'd like to display the date that each row in Column A displays
"Complete."

If the task in A1 is completed today, I'd like B1 to display "3/22/2010" and
for it to stay that way unless changed or deleted.

Thanks!

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
How do I run a macro from a event structure? SLE Excel Discussion (Misc queries) 4 December 22nd 07 09:56 PM
Event Macro running another macro inside K1KKKA Excel Discussion (Misc queries) 1 December 20th 06 08:21 PM
It seems to me that I need an event Macro, nick s Excel Worksheet Functions 8 November 28th 05 05:37 PM
'Event' macro George Gee New Users to Excel 18 August 27th 05 12:50 PM
Event Macro stevepain Excel Discussion (Misc queries) 6 August 5th 05 05:11 AM


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