Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copy value from formula result on event change of cell value

Hi,

I need to do something very tricky. I have a workbook where we track
the progress of a project by putting "x" in a cell when a milestone is
passed. What I would like to do is to save the date (of Today()) when
the "x" is entered in the cell. Pseudo code would be something like:
On event (cellvalue changes to x) -- catch todays date and store it
as hard coded value in another cell.

The thing I really need help with is to store the value from the
"Today()" formula as a hard coded value based on the change event of
entering x in the cell.

Tricky one - hope someone can help me with this!

Thanks!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Copy value from formula result on event change of cell value

Right click sheet tabcopy/paste thischange c4 and c5 to suit. Now when you
change the first cell the second will show today's date.

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("c4")) Is Nothing Then Exit Sub
If UCase(Target) = "X" Then Range("c5") = Date
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

wrote in message
...
Hi,

I need to do something very tricky. I have a workbook where we track
the progress of a project by putting "x" in a cell when a milestone is
passed. What I would like to do is to save the date (of Today()) when
the "x" is entered in the cell. Pseudo code would be something like:
On event (cellvalue changes to x) -- catch todays date and store it
as hard coded value in another cell.

The thing I really need help with is to store the value from the
"Today()" formula as a hard coded value based on the change event of
entering x in the cell.

Tricky one - hope someone can help me with this!

Thanks!


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,441
Default Copy value from formula result on event change of cell value

Copy the code below, right-click the sheet tab, select "View Code" and paste the code into the
window that appears.
As written, the code will store the date in column D when an x is entered into column A.

HTH,
Bernie
MS Excel MVP

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Range("A:A"), Target) Is Nothing Then Exit Sub
If Target.Cells.Count 1 Then Exit Sub
If Target.Value = "x" Then
Application.EnableEvents = False
Cells(Target.Row, "D").Value = Date
Application.EnableEvents = True
End If
End Sub


wrote in message
...
Hi,

I need to do something very tricky. I have a workbook where we track
the progress of a project by putting "x" in a cell when a milestone is
passed. What I would like to do is to save the date (of Today()) when
the "x" is entered in the cell. Pseudo code would be something like:
On event (cellvalue changes to x) -- catch todays date and store it
as hard coded value in another cell.

The thing I really need help with is to store the value from the
"Today()" formula as a hard coded value based on the change event of
entering x in the cell.

Tricky one - hope someone can help me with this!

Thanks!



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Copy value from formula result on event change of cell value

On 23 Maj, 16:00, "Don Guillett" wrote:
Right click sheet tabcopy/paste thischange c4 and c5 to suit. Now when you
change the first cell the second will show today's date.

Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("c4")) Is Nothing Then Exit Sub
If UCase(Target) = "X" Then Range("c5") = Date
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
wrote in message

...



Hi,


I need to do something very tricky. I have a workbook where we track
the progress of a project by putting "x" in a cell when a milestone is
passed. What I would like to do is to save the date (of Today()) when
the "x" is entered in the cell. Pseudo code would be something like:
On event (cellvalue changes to x) -- catch todays date and store it
as hard coded value in another cell.


The thing I really need help with is to store the value from the
"Today()" formula as a hard coded value based on the change event of
entering x in the cell.


Tricky one - hope someone can help me with this!


Thanks!- Dölj citerad text -


- Visa citerad text -


Splendid!

Both alternatives work as a charm!

Mille Grazi!
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
Copy formula down - cell references change - result is same for al ace Excel Worksheet Functions 6 November 13th 09 09:23 PM
Worksheet Change Event - copy cell to another sheet dhstein Excel Discussion (Misc queries) 2 October 12th 09 06:35 PM
Ws Selection Change Event Code, Copy a Cell problem Neal Zimm Excel Programming 3 September 28th 07 05:38 PM
Worksheet change event with cell linked to combo box result Fid[_2_] Excel Programming 5 December 22nd 06 08:55 PM


All times are GMT +1. The time now is 03:10 PM.

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"