Date

jcrownshaw

New Member
Joined
May 11, 2011
Messages
2
I am trying to get one cell to return todays date (static) when another cell is marked as "closed" so that I have a running record of when items are closed. Can you help?
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
In cell b1:

IF ($A$1="closed", TEXT( TODAY() ,"mm/dd/yyyy") ,"")

Edit:

No, I see what you're saying. You might need to use more than one cell for that if you're going to use formulas... or VBA.
 
Last edited:
Upvote 0
This assumes the date will be adjacent and to the left of the "closed" string entry.

In the worksheet object module:

Code:
Option Compare Text
 
Private Sub Worksheet_Change(ByVal Target As Range)
 
    If Target.Value = "Closed" Then Target.Offset(, -1).Value = Date
 
End Sub
 
Upvote 0
Click "Tools -> Macro -> Visual Basic Editor". Click "View -> Project Explorer". Double-click the node that has your sheet name on it. Then paste it in. You might want to make a copy first in case something goes wrong.
 
Upvote 0

Forum statistics

Threads
1,224,583
Messages
6,179,673
Members
452,937
Latest member
Bhg1984

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top