Time Stamp

toddlb83

New Member
Joined
Aug 4, 2023
Messages
2
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I am trying to write a function that creates a timestamp when a certain word is entered in a specific cell. The problem is, the value of the cell that the timestamp is based on is constantly changing. I want the timestamp to record the date the first time the formula is found true, and then keep that result.

here is the formula i have worked up so far: =IF(B4:B9="Complete",TODAY(),"")

1691154778137.png
 

Excel Facts

Pivot Table Drill Down
Double-click any number in a pivot table to create a new report showing all detail rows that make up that number
Welcome to the Board!

Right-click on the sheet tab name at the bottom of the screen, select "View Code", and paste this VBA code in the VB Editor window that pops up:
VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)

    Dim rng As Range
    Dim cell As Range

'   Check for changes in column B
    Set rng = Intersect(Target, Range("B4:B1000"))
    
'   If no changes between B4 and B1000, exit sub
    If rng Is Nothing Then Exit Sub
    
'   Check to see if value is "Complete" and if so, add date stamp to column G
    Application.EnableEvents = False
    
    For Each cell In rng
        If cell.Value = "Complete" Then cell.Offset(0, 5).Value = Date
    Next cell
    
    Application.EnableEvents = True
    
End Sub
This should do what you want automatically.
 
Upvote 0

Forum statistics

Threads
1,215,123
Messages
6,123,183
Members
449,090
Latest member
bes000

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